Skip to content

Instantly share code, notes, and snippets.

@Geoffrey-T
Forked from nicolasramy/tips-git.md
Created March 4, 2013 16:10
Show Gist options
  • Save Geoffrey-T/5083340 to your computer and use it in GitHub Desktop.
Save Geoffrey-T/5083340 to your computer and use it in GitHub Desktop.

Git

Remote

Get informations about the remote

git remote show origin

Tags

List local tags

git tag

Tag a specific commit

git tag -a TAG_NAME SHA1_COMMIT

List remote tags

git-ls-remote --tags

List local tags with short description

git tag -n

Replace tag

git tag OLD_TAG_NAME NEW_TAG_NAME

Delete tag

git tag - d TAG_NAME

Sharing Tags

git push origin --tags
git pull origin --tags

Diff

Differences between 2 branches - detailed

git diff master..develop > diffs.log

Differences between 2 branches - summary

git diff --name-status master..develop > diffs-summary.log

Differences between 2 files

git diff master:file.php develop:file.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment