Markdown Flavor

Toggle block

<details>
<summary>Click to toggle contents of `code`</summary>

CODE!

</details>

Alert styling

image.png

> [!NOTE]  
> Highlights information that users should take into account, even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]  
> Crucial information necessary for users to succeed.

> [!WARNING]  
> Critical content demanding immediate user attention due to potential risks.

> [!CAUTION]
> Negative potential consequences of an action.

View README.md localhost

pip install grip # <https://github.com/joeyespo/grip>
cd myrepo
grip # Running on <http://localhost:6419/>

Update: grip support with limited times of usage, we can use VSCode markdown previwer instead, it’s builtin.

Clone with Personal Access Tokens (PAT)

Go to this link to generate a new PAT. Then using your PAT as a password.

$ git clone <https://github.com/fakeuser/fake-repo.git>
Username: <your_username>
Password: <your_personal_access_token>

Clone via git@ (ssh)

<aside> ☝️ Update: It's easier if we use Github CLI!

</aside>

Below codes are for: using 2 different accounts via ssh with 1 default.

# Global (default to acc 1)
git config --global user.name "Your Name 1"
git config --global user.email "[email protected]"

# Per repo
cd /path/to/special-repo
git config user.name "Your Name 2"
git config user.email "[email protected]"

# Generate ssh key for each account
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_ed25519_account1
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_ed25519_account2

# in ~/.ssh/config
Host github.com-account1
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_account1

Host github.com-account2
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_account2
    
# add public key to github
cat ~/.ssh/id_ed25519_account1.pub
# Then go to Settings → SSH and GPG keys (choose Key type "Authentication Key")
cat ~/.ssh/id_ed25519_account1.pub
# The same

# Test
ssh -T github.com-account1

# Test git operations
git pull

# If: Repository not found
git remote -v
# If something like
origin	<https://github.com/SomeThing/something-hehe.git> (fetch)
origin	<https://github.com/SomeThing/something-hehe.git> (push)
# Do
git remote set-url origin [email protected]:SomeThing/something-hehe.git
# (If you clone this repo by Gitkraken, doing this still doesn't affect Gitkraken)

# Try again
git pull

Info