开发者

Branch ahead of origin/name by 7 commits

I am confused how my branch can be ahead. Here is what I did.

  • Using one computer (Mac) I pulled this branch from GitHub.
  • I added some image files to the project on my PC and pushed them to GitHub
  • I revisted my Mac and pulled the repo branch to get the new images.
  • git status on the Mac and I get that my branch is ahead of the origin/name by 7 commits

I am worried to commit these changes and push them. My local repo on my开发者_Go百科 PC has the latest version that I pushed to GitHub and I don't want to override those changes with unknown changes pushed from my Mac.

Any idea what has happened?


Visualizing the graph may be useful in order to see exactly where you diverged. Git may have automatically merged without you realizing. If two clients continually make commits and then pull, you will end up with lots of little merge bumps. If that is the case, pulling with --rebase might be your solution.

To view the graph, use one of the following:

  • git log --graph --decorate
  • gitk
  • GitX (for Mac)

The --decorate flag tells git-log to label each commit with the refs that point to it, which will show you where it thinks you are compared to origin.


Are you sure you have successfully pushed your changes to GitHub? Try gitk --all to get a visual representation of your repository.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜