Skip to content

Instantly share code, notes, and snippets.

@jhorman
Created January 11, 2011 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhorman/775194 to your computer and use it in GitHub Desktop.
Save jhorman/775194 to your computer and use it in GitHub Desktop.

Initialize and sync from github

git init
git remote add origin git@github.com:something/something.git
git pull origin master

Make sure that git push pushes tags

git config --add remote.origin.push 'refs/tags/:refs/tags/'

Resetting

Reset to head (losing all local changes) git reset --hard HEAD

Resolving merge conflicts on pull

If you want to just keep your copy

git checkout --ours file
git add file
git commit -m "blah"
git push origin master

If you want their copy

git checkout --theirs file
git add file
git commit -m "blah"
git push origin master

References

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