danielsokil
12/31/2019 - 10:50 PM

Git

Git Commands

Branch & Merge

  • list branches, git branch.
  • * will appear next to the active branch

Remove Untracked Files

  • Dry run, git clean -n
  • Remove files, git clean -f
  • Remove directories, git clean -fd
  • Remove ignored files, git clean -fX
  • Remove ignored and non-ignored files, git clean -fx

Save Changes For Later Use

  • Save local changes, git stash
  • Resume local changes, git stash pop

Undo Merge

  • Revert un-committed merge git merge --abort