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

Report a bug, about track remote repository.

From
CHCheeray Huang <cheeray.huang@gmail.com>
Date
Oct 20, 2012, 18:49 UTC
Message-ID
<5082F255.9060600@gmail.com>
Hi,

I think I found a bug, when I used local branches to track remote branch. But I'm not very sure, can anyone double check this? I'd like to finger this out. I think you can reproduce this bug as below steps:

precondition:

Suppose that you have a remote branch in repository, named origin/work. And then you want to track it with a local branch.

Steps:
1. So you can do this:
git checkout -t origin/work

now, you have a local branch also named "work" to track "origin/work". It works nicely, you can use "push/pull" command without any detail parameters to sync anything with the remote branch.

2. Create another branch, ex. named "work2", to track "origin/work" 
again, though maybe there are not so many people that will do like this.

You will find that local branch "work2" can't "push" to "origin/work". ex. After you committed something in work2, you typed "git status", git would tell you:

Your branch is ahead of 'origin/work' by x commit.

And then you used "git push", git can't display the information about changing hash value in remote branch, just printed "everything is up to date".

Actually, you can use some exact parameters to solve this,  such as:
git push origin work2:work
But, I still think it is a bug.

BTW, I found this bug when I used github. I don't know whether it is related to github.

-- 
B&R,
Cheeray
Next: Philip Oakley
Message 1 of 3 in “Report a bug, about track remote repository.”
  1. Cheeray HuangOct 20, 2012
  2. Philip OakleyOct 20, 2012
  3. Cheeray HuangOct 21, 2012

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.