Skip to content

Instantly share code, notes, and snippets.

@elhoyos
Last active December 25, 2015 17:39
Show Gist options
  • Select an option

  • Save elhoyos/7014273 to your computer and use it in GitHub Desktop.

Select an option

Save elhoyos/7014273 to your computer and use it in GitHub Desktop.
Do this instead of... Simple Git suggestions to make our life easier

When merging to a non-feature branch you'd normally use git merge <branch>. You can do better for the sake of easier reverts and help the review process:

git merge --no-ff <branch> 

The naive way to update from upstream is git pull but is better to try:

git up

You did a wrong commit but its already pushed. git reset --hard HEAD~3; git push <branch> will work for you, but your folks will shout things in your face. You better use this:

git revert HEAD~3
git push <branch>

More info here

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