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

Re: Git branching & pulling

From
Wink Saville <wink@saville.com>
Date
May 19, 2007, 16:31 UTC
Message-ID
<d4cf37a60705190931rca1187ap9b98becb6c7c3b2a@mail.gmail.com>
In-Reply-To
<7vveepxr7m.fsf@assigned-by-dhcp.cox.net>
> Ah, if you ever interact with only single remote repository,
> then that is certainly a valid reason not to say anything else.
For reference my git version:

wink@ic2d1:~/linux/kvm-linux-2.6$ git --version git version 1.5.2.rc0.g520d

This is very close to my situation, except in the mothership is linux-2.6.git, kvm.git or git.git. So I have two primary objectives, first periodically synchronize my repository with the remotes. Second, synchronize my branches with their "remotes".

My expectations are that when I'm on a branch and do a git-pull with no parameters I should "fetch" from that branches "remotes" and "merge" into the current branch. This is how linus's repo seems to work.

But with kvm.git it appears I need to be quite explicit:

wink@ic2d1:~/linux/kvm-linux-2.6$ git-checkout -b test Switched to a new branch "test" wink@ic2d1:~/linux/kvm-linux-2.6$ git-pull fatal: 'master': unable to chdir or not a git archive fatal: The remote end hung up unexpectedly Cannot get the repository state from master wink@ic2d1:~/linux/kvm-linux-2.6$ git-pull . error: Object 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c is a tree, not a commit error: Object 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c is a tree, not a commit Already up-to-date. wink@ic2d1:~/linux/kvm-linux-2.6$ git-pull . master Already up-to-date. wink@ic2d1:~/linux/kvm-linux-2.6$

So to get consistent behavior it seems I should always use the two parameter form. But the behavior with no parameters was very convenient and less error prone as the branch should always know from where it was cloned:)

Here is another experiment cloning a local repo created with 1.5.2-rc0 where tried git-pull's:

wink@ic2d1:~$ git-clone testgit testgit-clone
Initialized empty Git repository in /home/wink/testgit-clone/.git/
remote: Generating pack...
remote: Done counting 6 objects.
remote: Deltifying 6 objects...
remote: /6) done/6) done
remote: Total 6 (delta 0), reused 0 (delta 0)
Indexing 6 objects...
 100% (6/6) done
wink@ic2d1:~$ cd testgit-clone/
wink@ic2d1:~/testgit-clone$ git-pull
Already up-to-date.
wink@ic2d1:~/testgit-clone$ git-pull .
Already up-to-date.
wink@ic2d1:~/testgit-clone$ git-pull ../testgit
Already up-to-date.
wink@ic2d1:~/testgit-clone$ git-pull ../testgit master
Already up-to-date.
wink@ic2d1:~/testgit-clone$ git-checkout -b test master
Switched to a new branch "test"
wink@ic2d1:~/testgit-clone$ git-pull .
Already up-to-date.
wink@ic2d1:~/testgit-clone$ git-pull . master
Already up-to-date.
wink@ic2d1:~/testgit-clone$ git-pull
Warning: No merge candidate found because value of config option
         "branch.test.merge" does not match any remote branch fetched.
No changes.
wink@ic2d1:~/testgit-clone$
Why did last git-pull generate the warning, this seems wrong?
Regards,
Wink Saville
Previous: Junio C HamanoNext: Josef Weidendorfer
Message 7 of 12 in “Git branching & pulling”
  1. Wink SavilleMay 19, 2007
  2. J. Bruce FieldsMay 19, 2007
  3. Junio C HamanoMay 19, 2007
  4. Junio C HamanoMay 19, 2007
  5. Steven GrimmMay 19, 2007
  6. Junio C HamanoMay 19, 2007
  7. Wink SavilleMay 19, 2007
  8. Josef WeidendorferMay 20, 2007
  9. Wink SavilleMay 23, 2007
  10. Junio C HamanoMay 23, 2007
  11. Document branch.autosetupmerge.Paolo Bonzini, May 23, 2007
  12. Josef WeidendorferMay 23, 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.