1

I'm having an issue. I have switched to a branch some-feature. I do git pull origin some-feature and it says already up to date. I check a file I know has changed and the changes are not there. I check bit bitbucket and the changes are there.

I have tried git reset --hard HEAD followed by git clean --force and another pull but no luck. Why is git lying to me and what can I do to fix it?

Mark Longair
  • 446,582
  • 72
  • 411
  • 327
Matthew
  • 11,203
  • 9
  • 38
  • 44

1 Answers1

2

Are you actually on the right branch?

git checkout some-feature

Otherwise, check git log origin/some-feature and make sure the commit you expected is at the top.

Finally, Are you sure that origin refers to bitbucket? Check the entry for bitbucket in .git/config

(Update: seems like the local branch some-feature wasn't set up to track origin/some-feature. See this answer for now to set up tracking.)

Community
  • 1
  • 1
Aaron McDaid
  • 26,501
  • 9
  • 66
  • 88
  • Yep, on the right branch. Yep, the commit at the top matches the commit reported by bitbucket when I browse that file. git remote -v reports the correct repo. – Matthew Jan 16 '12 at 23:45
  • So `origin/some-feature` and `origin` point at different places? The former is correct, and the latter isn't? Maybe try `git checkout origin/some-feature` in order to be explicit. – Aaron McDaid Jan 16 '12 at 23:48
  • That worked. I think the problem is that I created some-feature on another computer. Then on this computer I did git checkout -b some-feature and then tried to pull. It makes sense that despite the names they are different branches. I'll remember to checkout that way in the future. thank you. – Matthew Jan 16 '12 at 23:52
  • Aha. I think you need to set up your local `some-feature` branch to track `origin/some-feature`. I don't know how to do that, but I'm pretty sure it's easy. I the meantime you could try `git checkout some-feature; git rebase origin/some-feature` to attempt to replicate the changes in the 'local' `some-feature` branch. – Aaron McDaid Jan 16 '12 at 23:57
  • .. See this answer for how to set up tracking to link `some-feature` with `origin/some-feature`: http://stackoverflow.com/questions/520650/how-do-you-make-an-existing-git-branch-track-a-remote-branch – Aaron McDaid Jan 16 '12 at 23:58