git/list[1] front-page[2] threads[3] people[4] search[5] about
 

BUG: For first push to a bare repo, using "--tags" prevents creation of master branch

From
MDMichael Darling <darlingm@gmail.com>
Date
May 29, 2015, 00:10 UTC
Message-ID
<CABRuA+iVRZR9SxvYVCO5zd0hZEbn6tioyP6dZ5xSbaAeNF4w+w@mail.gmail.com>

Using git version 2.4.1.171.ga34f239, and gitolite v3.6.3 (b05c94ff). I apologize I don't know enough about the client vs server functions, during a git push, to know whether this is a git or gitolite issue.

After cloning the public glibc repo, and creating a new bare repo on my local gitserver by adding it to gitolite.conf and pushing it:

$ git push --set-upstream origin
Counting objects: 339319, done.
Delta compression using up to 10 threads.
Compressing objects: 100% (55496/55496), done.
Writing objects: 100% (339319/339319), 99.28 MiB | 22.67 MiB/s, done.
Total 339319 (delta 283044), reused 331722 (delta 276505)
To gitserver:glibctest
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

**After resetting to before the last push**: (removing and re-cloning my clone of the public glibc repo, and resetting the repo on my local gitserver back to a new bare repo (removing the repo from gitolite.conf, pushing the conf, removing the repo directory in the gitolite user, re-adding the repo to gitolite.conf, and pushing the conf):

$ git push --tags --set-upstream origin
Counting objects: 382283, done.
Delta compression using up to 10 threads.
Compressing objects: 100% (62075/62075), done.
Writing objects: 100% (382283/382283), 101.16 MiB | 19.64 MiB/s, done.
Total 382283 (delta 316774), reused 376933 (delta 312407)
To gitserver:glibctest
 * [new tag]         cvs/ChangeLog -> cvs/ChangeLog
 * [new tag]         ... <a bunch more> ...
 * [new tag]         glibc-2.9 -> glibc-2.9
Note this time there is NO:
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

Hence, my local gitserver has no master branch. If cloning in another location, I get a "warning: remote HEAD refers to nonexistent ref, unable to checkout." that I don't get if I do a "git push --set-upstream origin && git push --tags" instead.

Next: Matthieu Moy
Message 1 of 9 in “BUG: For first push to a bare repo, using "--tags" prevents creation of master branch”
  1. Michael DarlingMay 29, 2015
  2. Matthieu MoyMay 29, 2015
  3. Junio C HamanoMay 29, 2015
  4. Matthieu MoyMay 29, 2015
  5. Junio C HamanoMay 29, 2015
  6. Junio C HamanoMay 29, 2015
  7. Matthieu MoyMay 29, 2015
  8. Junio C HamanoMay 29, 2015
  9. Junio C HamanoJun 2, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.