Git CLI
November 21, 2019
Git Cheat Sheet
My go to cheat sheet from git-tower
Other Git Commands
Other git commands that I’ve found useful over the years.
Create local tracking branch from remote branch (option a)
git fetch
git checkout <branch>Create local tracking branch from remote branch (option b)
git checkout --track <remote/branch>Push and set up remote tracking branch from local branch
git push -u <remote> <branch>Delete a remote branch
git push --delete <remote> <branch>Single line git logs
git log --onelineRemove untracked files (dry run)
git clean -nRemove untracked files (for real)
git clean -iLocal prune
git pruneRemote prune
git remote prune <remote>Built-in Git GUI
gitkGit Tags
List tags
git tagAdd annotated tag
git tag -a <tagname> -m <message>Push single tag to remote
git push <remote> <tagname>Push all tags to remote
git push <remote> --tagsDelete local tag
git tag -d <tagname>Delete remote tag
git push --delete <remote> <tagname>A blog written by Marty Sanchez, a web developer who lives and works in San Diego.