Git

Git Cheatsheet

Git License EUPL 1.2 Become a sponsor to JV-conseil Follow JV conseil on StackOverflow Follow JVconseil on Twitter Follow JVconseil on Mastodon Follow JV conseil on GitHub

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

src :point_right: theserverside.com

Force a "git pull"

git fetch --all
git reset --hard
git clean -f -d
git pull

src :point_right: stackoverflow.com

Revert to a good commit

cd {your-git-repo}
git log
git push origin +{good-commit-sha}:master

src :point_right: stackoverflow.com

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 :point_right: Signing tags

Delete tags

git tag --delete "2.0"
git push origin --delete "2.0"

References ๐Ÿ“š

Sponsorship

If this project helps you, you can offer me a cup of coffee โ˜•๏ธ :-)

Become a sponsor to JV-conseil