user3270211
user3270211

Reputation: 933

Git pull gives 'Already up-to-date' after committing

I am working on a something where I use two different VM's. On the first one, I create a file that I add, commit and push to the repository. Later, I clone the repository on the other VM. Then I go back to the first VM to do some changes in the file to add and commit the changes to then pull on the second VM. The problem is that I don't get the changes that are done, it says: Already up-to-date.

On the clone VM, git log outputs:

root@master:/home/test/hello/learning# git log
commit 1f15a20164b57303d1cc8bb8f518b4560ad44ad9
Author: test <[email protected]>
Date:   Tue Jan 13 14:30:33 2015 +0000

    2nd

commit 77950eb49e28aadd49ddb78b9a48701c4ecb910a
Author: test <[email protected]>
Date:   Tue Jan 13 14:27:53 2015 +0000

    Forste

On the VM where I created the repository, git log gives:

root@python:/home/ubuntu/learning# git log
commit 89fead2b83d16373723d06954a0f4f29a695d6f4
Author: test <[email protected]>
Date:   Tue Jan 13 14:34:31 2015 +0000

    NA

commit 1f15a20164b57303d1cc8bb8f518b4560ad44ad9
Author: test <[email protected]>
Date:   Tue Jan 13 14:30:33 2015 +0000

    2nd

commit 77950eb49e28aadd49ddb78b9a48701c4ecb910a
Author: test <[email protected]>
Date:   Tue Jan 13 14:27:53 2015 +0000

    Forste

And git status gives:

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

Upvotes: 0

Views: 431

Answers (1)

Chris
Chris

Reputation: 137182

You forgot to push your new commit, which the output of git status is actually telling you:

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.  <--- Right here
#
nothing to commit (working directory clean)

Remember that Git is distributed. Almost anything you do only exists on your local machine until you explicitly share it, usually by running something like git push or git push origin master.

Upvotes: 1

Related Questions