Git essentials

Git essentials

Commits

To recover a commit after it failed, use

git commit -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG

Branch switching

To switch to a different branch you can use

git switch <branch> 

To fetch the latest branch status use

git fetch (origin)

and to pull the latest updates

git switch master #Alternative stay in current branch to only fetch current
git pull

Push

To push to a specific branch use

git push --set-upstream origin <branch>