A collection of very useful and little-known Git commands.
Version FR 👉🏽 here
Also want to add a command that you find useful ?
Feel free to fork the project to add your contribution ✨
git checkout -b name_of_my_new_branch
git push origin --delete
# after
name_of_my_remote_branch
git pull origin my_branch
git clone -b name_of_my_remote_branch git_project_url
git commit --amend
git add my_file
# after
git commit --amend
git log
# replace N with the number of commits you want to display
git log -N
# date in DD/MM/YYYY format
git log --since=date --until=date
git shortlog
# it can be thought of as a GUI wrapper for git log command
gitk
# only the commit is removed from Git, your files remain modified
git reset HEAD^
# only the commit is removed from Git, your files remain modified
git reset HEAD^^
# this will unconfirm all your work
git reset --hard HEAD^
# to search for all occurrences of "hello"
git grep "hello"
# detects and reports corrupted objects or broken links in the repository
git fsck