git: change history, undo and a remote repository
cheat sheet · git 2.x https://lab.dimsanych.ru/en/wiki/git/Cheat sheet
-
git statuswhat changed, which branch -
git diffuncommitted changes -
git add -A ; git commit -m "msg"commit -
git log --oneline -10short history -
git log -p -- site.confa file's history with changes -
git blame site.confwho changed each line, and when -
git restore site.confthrow away an uncommitted change -
git revert --no-edit <commit>undo a commit with a new commit -
git fetch ; git statuswhat is new in the remote -
git pullget and merge -
git pushsend your commits -
git stash ; git stash popshelve a change and bring it back
Options
Below are the main git subcommands; the full list is in man git,
git help <command>.