Your Linux Data Center Experts

Sean's Git Cheatsheet

By  Sean Reifschneider Date March 2, 2013

Changes in Local Copy

git status

Tagging Code for Release

git tag -s release-1.00

Un-rm or Revert Local Changes

git checkout HEAD -- $FILENAME

Reverting to Previous Upstream Commit

I used this when I had pushed up a new change to github and after suggestions by a reviewer I decided to completely undo it and start over.

git push --force origin OLD_COMMIT_ID:master
git reset --hard origin/master

Merging Upstream Code

#  one-time setup
git remote add upstream $UPSTREAM_GIT_URL

#  to later pull in changes from upstream
git fetch upstream
git merge upstream/master

Join our other satisfied clients. Contact us today.

comments powered by Disqus