Git Setup - Habilya/LearningCourseNotes GitHub Wiki

Setting Git User

git config --global user.name "Habilya"
git config --global user.email "[email protected]"

Setting up GitHub SSH keys

cd ~/.ssh

ssh-keygen -t rsa -C "[email protected]"

> id_rsa

> [PASSWORD]

cat id_rsa.pub

{Copy paste in GitHub Account Settings}

ssh -T [email protected]

Adjust existing repos to use SSH

git remote -v

Looks like this:
origin  https://github.com/Habilya/EliteDangerous_AHK.git (fetch)
origin  https://github.com/Habilya/EliteDangerous_AHK.git (push)

git remote set-url origin [email protected]:Habilya/EliteDangerous_AHK.git

git remote -v

looks like this:
origin  [email protected]:Habilya/EliteDangerous_AHK.git (fetch)
origin  [email protected]:Habilya/EliteDangerous_AHK.git (push)

Git create new local branch from updated dev

git status
git stash --include-untracked
git fetch
git checkout dev
git pull
git checkout -b logger-refactoring
git stash pop

Git cherry pick

git log --oneline logger-rework 
git cherry-pick af02e0b

Git squash commit

git log --oneline
git rebase -i HEAD~2
# *p* for first commit *s* for others
# save
# Keep only one commit message
git log --oneline
git checkout -b add-headless-logger
git push