Local branch lost remote tracking branch

Go To StackoverFlow.com

1

I have a strange situation I haven't encountered before.

I've just done git fetch gotten updates for both my develop and master branches:

From remote-host:my_repo
   f3946b5..c3b2d44  develop    -> origin/develop
   72830fe..14d8be6  master     -> origin/master

Git status on my master branch correctly reports that I'm behind. However, on my develop branch, there's no indication that I'm behind:

dumbo:my_repo wade$ git checkout develop
Switched to branch 'develop'
dumbo:my_repo wade$ git status
# On branch develop
nothing to commit (working directory clean)

I determined that it's because my local develop branch is no longer tracking origin/develop:

dumbo:my_repo wade$ git branch -avv
 * develop                   24f29e2 Updated config
  master                    60d5d8f [origin/master: behind 109] Deploy w/ session_fix
  remotes/origin/HEAD       -> origin/master
  remotes/origin/develop    c3b2d44 Deploy changes
  remotes/origin/master     14d8be6 Deploy changes

Now, I know I can fix it with git branch --set-upstream, but my question is, how did it get clobbered? I certainly didn't take any conscious action to delete the remote tracking association.

My normal workflow is:

  (on branch develop)
  git stash (if necessary)
  git fetch
  git merge or git rebase origin/develop
  git checkout master
  git merge origin/master
  git checkout develop

Any thoughts on what actions would cause a tracking branch association to get clobbered?

2012-04-05 18:23
by wadesworld


0

It's really hard to tell from this information. I would guess that you accidentally deleted the branch and when you recreated it, you did not indicate tracking.

Another way is that you may have edited the config by hand and accidentally deleted the line.

2012-04-05 19:27
by Adam Dymitruk
Yeah, I knew it was not much to go on. I certainly didn't delete it. I guess losing it in a config editing session is the only likely answer, though I don't recall it happening - wadesworld 2012-04-05 19:46
Ads