Skip to content

Instantly share code, notes, and snippets.

@jhuttner jhuttner/tag test
Created Jun 30, 2012

Embed
What would you like to do?
Refs are the same.
The refs for tags are the same.
01:tagtest(master) jhuttner$ git remote -v
origin git@github.com:jhuttner/tagtest.git (fetch)
origin git@github.com:jhuttner/tagtest.git (push)
01:tagtest(master) jhuttner$ git ls-files
foo.txt
01:tagtest(master) jhuttner$ echo "barbar" >> foo.txt
01:tagtest(master) jhuttner$ git add foo.txt
01:tagtest(master) jhuttner$ git commit -m "Add barbar line."
[master da1f075] Add barbar line.
1 file changed, 1 insertion(+)
01:tagtest(master) jhuttner$ git push origin
Counting objects: 5, done.
Writing objects: 100% (3/3), 257 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:jhuttner/tagtest.git
7810f06..da1f075 master -> master
01:tagtest(master) jhuttner$ git tag
foo-15
01:tagtest(master) jhuttner$ git tag -a foo-16 -m "Create tag 16"
01:tagtest(master) jhuttner$ git tag
foo-15
foo-16
01:tagtest(master) jhuttner$ git push origin --tags
Counting objects: 1, done.
Writing objects: 100% (1/1), 168 bytes, done.
Total 1 (delta 0), reused 0 (delta 0)
To git@github.com:jhuttner/tagtest.git
* [new tag] foo-16 -> foo-16
01:tagtest(master) jhuttner$ git ls-remote --tags origin
37807bd4346f5c545619129c48e015e6485300c1 refs/tags/foo-15
7810f0624867d3b1029d31a071b00b93647b2509 refs/tags/foo-15^{}
b72395908d1b2321ffda8d9a5f99c3206521c637 refs/tags/foo-16
da1f075dbd2c442fae97f8e8346dec17481511bb refs/tags/foo-16^{}
01:tagtest(master) jhuttner$ git checkout b72395908d1b2321ffda8d9a5f99c3206521c637
Note: checking out 'b72395908d1b2321ffda8d9a5f99c3206521c637'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at da1f075... Add barbar line.
01:tagtest((foo-16)) jhuttner$ git checkout da1f075dbd2c442fae97f8e8346dec17481511bb
HEAD is now at da1f075... Add barbar line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.