Image by brgfx

Below is a table with commands I don’t run frequently enough to remember them, and have to rely on searching on internet again and again. Now it’s saved somewhere. 😀

Last update: August 21st, 2022.

OperationCommand
Commit without filesgit commit -m "some message" --allow-empty
List commits in one line eachgit log --oneline
Remove local taggit tag -d <tag_name>
Remove remote taggit push --delete origin <tag_name>
Stash changesgit stash
Retrieve changes from stashgit stash pop
Delete local uncommitted changesgit reset --hard
Revert a commitgit revert <commit_ID>
Rebasegit rebase <branch>
Rebase interactivegit rebase -i <branch>
Add a remotegit remove add <alias> <uri>

What about you? Do you want to share git commands you always forget?

Tags: git  cheat 
comments powered by Disqus