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

Question on git fetch to bare repo

From
Bill Lear <rael@zopyra.com>
Date
Feb 8, 2007, 22:28 UTC
Message-ID
<17867.41997.561756.679778@lisa.zopyra.com>

If I have not yet made myself unwelcome, I now have another problem using git 1.4.4.1.

I have a public bare repo I created yesterday:

% mkdir project && cd project % git --bare init-db --shared % git --bare fetch git://source/project [All seems well]

I have a private repo:

% mkdir project && cd project % git clone /repos/git/project [All is well]

A co-worker checks something in to our company repo, so I go to my public repo to fetch the changes:

% cd /repos/git/project
% git --bare fetch -v git://source/project
remote: Generating pack...
remote: Done counting 230 objects.
remote: Result has 152 objects.
remote: Deltifying 152 objects.
remote:  100% (152/152) done
Unpacking 152 objects
remote: Total 152, written 152 (delta 109), reused 90 (delta 51)
 100% (152/152) done
* fetched git://source/project
  commit: 5c2d43d
I then go to my private repo to pull from my public one:
% cd ~/project
% git branch
  topic
* master
% git pull
Already up-to-date.
% cat .git/remotes/origin
URL: /repos/git/project
Pull: refs/heads/master:refs/heads/origin
Pull: refs/heads/topic:refs/heads/topic
[All seems well with this repo ??]
I try to push from my private to my public:

% git push /repos/git/project Everything up-to-date

I go back to my public repo, and poking around, can't see what is wrong.
The commit that the fetch says it pulled is there, if I do:

% cd /repos/git/project % git --bare show -t 5c2d43d

the patch comes out exactly as it did in my email notification, so I know it's there.

I tried then to be more forceful, and did another fetch like this, which I sort of expected to fail:

% git --bare fetch -v git://source/project master:master
remote: Generating pack...
remote: Done counting 230 objects.
remote: Result has 152 objects.
remote: Deltifying 152 objects.
remote:  100% (152/152) done
Unpacking 152 objects
remote: Total 152, written 152 (delta 109), reused 90 (delta 51)
 100% (152/152) done
* refs/heads/master: fast forward to branch 'master' of git://source/project
  old..new: 37e2298..5c2d43d
Cannot fetch into the current branch.
Having enabled the logs, I can investigate a bit:

% cat logs/refs/heads/master 37e229835103a11365b1e081f9b9987a88437e62 5c2d43dc819fc1bc37ebae1696c3fbfd6a4401db Bill Lear <rael@zopyra.com> 1170973321 -0600 fetch git://source/project: fast-forward 5c2d43dc819fc1bc37ebae1696c3fbfd6a4401db 37e229835103a11365b1e081f9b9987a88437e62 Bill Lear <rael@zopyra.com> 1170973321 -0600 fetch git://source/project: Undoing incorrectly fetched HEAD.

And, my branches seem to be there, properly:
% git --bare branch
  topic
* master

So, I'm confused. Why does my fetch seem to fetch things the first time, yet I cannot pull these into my private repo? I could swear I just did this same sequence of operations on Monday and it worked.

Perhaps I just need a vacation ...
Bill
Next: Jakub Narebski
Message 1 of 10 in “Question on git fetch to bare repo”
  1. Bill LearFeb 8, 2007
  2. Jakub NarebskiFeb 8, 2007
  3. Johannes SchindelinFeb 9, 2007
  4. Johannes SchindelinFeb 9, 2007
  5. Jeff KingFeb 9, 2007
  6. Bill LearFeb 9, 2007
  7. Bill LearFeb 12, 2007
  8. Jeff KingFeb 13, 2007
  9. Junio C HamanoFeb 13, 2007
  10. Jeff KingFeb 13, 2007

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.