Git Cheatsheet
Table of Content
Config
Review your git configuration and settings
git --version
git config --list
Clone a specific branch
git clone --branch development https://github.com/username/project.git
Force a "git pull"
git fetch --all
git reset --hard
git clean -f -d
git pull
Revert to a good commit
cd {your-git-repo}
git log
git push origin +{good-commit-sha}:master
Tags
List tags
git tag --list --column --sort tag
Signing tag with -s
git tag --sign "2.0" --message "Stable โจ"
git push origin --tags
src Signing tags
Delete tags
git tag --delete "2.0"
git push origin --delete "2.0"
References ๐
- Complete list of all commands - Git official manual
- Git Cheat Sheets - GitHub Training Kit, open source courseware from the GitHub Professional Services team
- Git Cheat Sheets - GitHub Git Cheatsheet (PDF)
- Git Cheat Sheets - GitLab Git Cheatsheet
Sponsorship
If this project helps you, you can offer me a cup of coffee โ๏ธ :-)