简体   繁体   中英

Git merge and pull not pulling the latest code

I have a private repository on Github with 2 branches:

  1. Master
  2. Company

Now in a few specific files the code is different in the Master branch and the Company branch and I can see that in my repository on github.com . But when I try to do a git pull origin master I get the following message:

* branch              master     -> FETCH_HEAD
Already up-to-date

Even when I try to do git merge master I get the same message. Why isn't my code getting updated from Github? Is there an intermediate step I missed?

EDIT:

I added new code to master branch and then switched to the company branch and it did recognize the changes and merged it properly in the company branch.

I did see a weird commit on my master branch by one of the collaborators which basically states Merge branch master of https://github.com/repo-name . Could this merge on master with itself be a reason for this weird situation? I could be completely wrong here, I'm pretty much just grasping at straws over here.

Already up-to-date means that your company branch has all the commits currently on master , but the opposite is not necessarily true.

If you wish to make the two branches identical, you need to update the master branch with the commits from company too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM