Cheatsheet Git
Cheatsheet Git
git clone Clone an existing repository git bisect start Begins the bisect process
git init Clone a local repository git bisect good/bad <ta‐ Marks <tag> as a broken or working
git add Add files to staging g> version
git commit Commit staged changes to the repository git bisect good/bad Marks the commit as good or bad
git commit --amend Reword the last commit message git bisect reset Ends the bisect process
git pull Get the latest changes and merge git log -- Only show commits in a certain file
<file>
git push Publish local changes to the
repository git log -- Display a log with only merge commits
merges
git push <remote> :<bran‐ Deletes remote branch
ch> git Group commits by their authors
shortlog
git reset --hard HEAD Undo local commits
git diff View the difference between two commits
git rebase <br‐ Takes the current branch's commits and applies
anch> them on top of another base
git rebase -i Changing commits in ways such as editing,
deleting or squashing
git rebase -- Staging files changes during interactive rebase
continue
git rebase -- Terminates the process
abort
git cherry-pick Choose commits from one branch and apply it
<commit> onto another