2

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
WinWin
  • 7,493
  • 10
  • 44
  • 53

2 Answers2

6

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

Community
  • 1
  • 1
Andy
  • 44,610
  • 13
  • 70
  • 69
  • 1
    Thanks +1. If I do `git push --all --tags ~/gitrepo` I receive: `error: --all and --tags are incompatible`, so I understand that pushing all branches *and* all tags in one command is not possible? – WinWin Jul 15 '11 at 01:17
  • `git push --all ~/gitrepo` works great. Now I need to see how to add the tags. – WinWin Jul 15 '11 at 01:23
  • 1
    `git push --tags ~/gitrepo` **adds** all the tags. Nice! – WinWin Jul 15 '11 at 01:28
  • I honestly have never tried it, but it would appear that that is the case. [link](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577935) – Andy Jul 15 '11 at 01:32
1

You need to do a separate push with the --tags option. Secondly, you should be calling gitk with the --all option to show all branches. Or you could just specify the ones you want.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141