Skip to content

Instantly share code, notes, and snippets.

@s0kil
Created December 31, 2019 22:50
Show Gist options
  • Save s0kil/f73995c48ec3f844cde62d7af138e455 to your computer and use it in GitHub Desktop.
Save s0kil/f73995c48ec3f844cde62d7af138e455 to your computer and use it in GitHub Desktop.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment