Search code examples
gitgit-pushgit-branchgit-tag

pushed git repository missing branch & tag names on gitk


I just did my first ever git push:

~/sb/ws> git push ~/gitrepo master:master
Counting objects: 1360, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (998/998), done.
Writing objects: 100% (1360/1360), 342.15 KiB | 20 KiB/s, done.
Total 1360 (delta 729), reused 0 (delta 0)
To /home/gitrepo
 * [new branch]      master -> master

It seems to have gone well, but when fire gitk in the new (bare) gitrepo, I only see the commit comments: The branch & tag names disappeared!

Why?

Is there a way to get them back?


Solution

  • To push the tags, you need to add --tags to your push.

    By default you only pushed the master branch.
    To push individual branches (with tags) do git push ~/gitrepo branchname --tags To push all branches do git push --all. Do a separate git push --tags if you want to push all tags.

    Here's a post on how to default to pushing all branches.

    edit: Added info from Winwin's comments