Where to start First steps track · 15 stages
Linux Labs

git: change history, undo and a remote repository

cheat sheet · git 2.x https://lab.dimsanych.ru/en/wiki/git/

Cheat sheet

  • git status what changed, which branch
  • git diff uncommitted changes
  • git add -A ; git commit -m "msg" commit
  • git log --oneline -10 short history
  • git log -p -- site.conf a file's history with changes
  • git blame site.conf who changed each line, and when
  • git restore site.conf throw away an uncommitted change
  • git revert --no-edit <commit> undo a commit with a new commit
  • git fetch ; git status what is new in the remote
  • git pull get and merge
  • git push send your commits
  • git stash ; git stash pop shelve a change and bring it back

Options

Below are the main git subcommands; the full list is in man git, git help <command>.

Loading…