Skip to content

Instantly share code, notes, and snippets.

@dlucian
Last active November 21, 2017 12:58
Show Gist options
  • Save dlucian/43399b9f1c01776919b6f81d540a5191 to your computer and use it in GitHub Desktop.
Save dlucian/43399b9f1c01776919b6f81d540a5191 to your computer and use it in GitHub Desktop.
Git Magic Tricks

Useful git operations in a developer's daily work

Undo all changes since last commit

Source

git reset HEAD --hard
git clean -fd

Resolve conflicts with either ours or theirs

For each conflicted file you get, you can specify:

git checkout --ours -- <paths>
# or
git checkout --theirs -- <paths>

source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment