8

I have some changes I made from another computer and sent it to remote repository.
When I try to make a git pull origin <branch> from home to get those changes it
says Already up-to-date but the changes are not in my computer, the files have not changed.

Why?

Edit 01:

When I try git log

commit 10ewwqe9989861ad33335e40188dcab598bc2312 Author: Name
Date: Sun Nov 27 23:46:40 2016 -0200
< commit message here >

If I check this commit code/name on bitbucket commits section, I see that THIS commit is one behind than the last commit present in my remote repository.

Edit 02:

>$ git remote -v

origin  https://bitbucket.org/username/repositoryName (fetch)  
origin  https://bitbucket.org/username/repositoryName (push)    

>$ git fetch origin

From https://bitbucket.org/username/repositoryName
 * [new branch]      myBranch -> origin/myBranch  

>$ git log myBranch..origin/myBranch

commit 0220ff...
Author: John Doe <[email protected]>
Date:   Mon Dec 28 16:43:07 2016 -0200

    Name of my last update to remote repository  

The log command shows the right last commit, the last one that is in my remote repository and the one I want to bring to my local files... But local files still unchanged.

20
  • When you say origin it loads them, but you are most likely on a local branch. Remove origin and pull a branch that's linked to that remote branch Commented Feb 2, 2017 at 13:47
  • did you checkout your branch? git checkout <branch>
    – Dezigo
    Commented Feb 2, 2017 at 13:49
  • @Dezigo Yes. I checkedout to the same remote branch. Commented Feb 2, 2017 at 13:50
  • 2
    You need to check you remote repo, if you pushed successfully? And if the commit id in remote branch is the same as your local branch?
    – Marina Liu
    Commented Feb 2, 2017 at 14:54
  • 1
    can you do a git fetch origin and then do a git log <branch>..origin/<branch> for us and give us the output? Make sure to use only two dots. Also, what does git remote -v show? Does it show unexpected remotes?
    – jbu
    Commented Feb 2, 2017 at 15:38

2 Answers 2

3

Assuming you did git pull origin myBranch already and it didn't work and since you know the most up-to-date commit, you can simply point your branch to that commit (in this case 0220ff): git reset 0220ff. Now run git log to verify that you're at the right commit. As VonC also mentioned, you could do create a branch pointing to the remote myBranch git checkout -B myBranch origin/myBranch but I suspect that if the git pull origin myBranch didn't recognize the latest change in origin/myBranch, then this might not work either.

I'm still not sure why git pull origin myBranch wouldn't work, but it seems like your local machine is aware of the latest change on origin/myBranch, so it should theoretically have 0220ff in its local object store ready for you to point your branch to this location.

1

The log command shows the right last commit, the last one that is in my remote repository and the one I want to bring to my local files... But local files still unchanged.

You can reset your myBranch to origin/myBranch with

git checkout master
git checkout -B myBranch origin/myBranch

(note the -B as myBranch already exists)

Not the answer you're looking for? Browse other questions tagged or ask your own question.