Skip to content

Instantly share code, notes, and snippets.

@johannez
Created February 26, 2014 18:22
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 johannez/12110224ee56b0f41249 to your computer and use it in GitHub Desktop.
Save johannez/12110224ee56b0f41249 to your computer and use it in GitHub Desktop.
Git commands
# Checkout branch for tracking old school.
git checkout --track -b dev origin/dev
# Undo local commits
git reset --hard
# Tag your release version and push it remote
git tag -a release-1.0 -m "Creating the first official version."
git push --tags origin master
# Create the zipped tar ball from HEAD
git archive --format=tar --prefix=projectname/ HEAD | gzip > filename.tar.gz
# projectname = Folder name when you extract the tar
# filename = filename of the tar
# To create a real tag and not a lightweight:
git tag -a v1.0.0 -m "Creating the first official version."
# To display the tag
git show v1.0.0
# Show all available tags:
git describe --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment