Warning
Replace moazmohamed20
with your username
Replace moazmohamed15@outlook.com
with your email
git config --global init.defaultBranch main
git config --global user.name moazmohamed20
git config --global user.email moazmohamed15@outlook.com
Warning
Replace moazmohamed15@outlook.com
with your email
ssh-keygen -t rsa -b 4096 -C "moazmohamed15@outlook.com"
Important
You have to Generate SSH Key first.
Display Public Key:
cat ~/.ssh/id_rsa.pub
Tip
For cmd:
type ~/.ssh/id_rsa.pub
Copy and Pase In:
GitHub -> Settings -> SSH ang GPG keys -> New SSH key -> Key type:
Auth
Test Connection:
ssh -T git@github.com
Important
You have to Generate SSH Key first.
Display Public Key:
cat ~/.ssh/id_rsa.pub
Tip
For cmd:
type ~/.ssh/id_rsa.pub
Copy and Pase In:
GitHub -> Settings -> SSH ang GPG keys -> New SSH key -> Key type:
Signing
Configure Git globally:
git config --global gpg.format ssh
git config --global tag.gpgsign true
git config --global commit.gpgsign true
git config --global user.signingkey ~/.ssh/id_rsa
echo "# MyRepo" > README.md
git init
git add README.md
git commit -m "Initial Commit"
git remote add origin git@github.com:username/MyRepo.git
git push origin <Local>
git config --global alias.cfg "config --global"
git cfg alias.st "status"
git cfg alias.cm "commit -m"
git cfg alias.loge "log --oneline"
git cfg alias.branche "branch -vva"
git checkout -b fast-branch
git branch -m renamed-fast-branch
git push origin renamed-fast-branch
git branch new-branch
git checkout new-branch
git checkout main
git merge new-branch
git branch -d new-branch
git push origin main
git stash list
git stash clear
git stash save "Comment"
git stash pop stash@{0}
git stash apply stash@{0}
git stash drop stash@{0}
git stash show stash@{0}