git bash : how to check if there's a new commit available

前端 未结 2 1896
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 17:40

I use git with my friend to collaborate on a project. He created a repo in github consisting folders of each of our names, so everytime i update something, I upload it to th

2条回答
  •  [愿得一人]
    2020-12-06 18:19

    Answering your first two questions in turn:

    1. Assuming that origin refers to the GitHub repository in each case, you should just run git fetch origin. Then the "remote-tracking branch" origin/master will be at the version of master on GitHub and you can compare it with your master with git diff master origin/master to see the difference between those two versions, or git log master...origin/master to see the commits which are unique to either master or origin/master.
    2. Yes, you can copy the repository to a USB stick and pull from there. However, if you want to pull from the USB key onto another computer, you'll want to set up a remote that refers to the location of the repository on the USB key.

    With regard to whether there is a better way to do what you're doing, I'm afraid I don't understand clearly enough what you're doing or trying to achieve to comment sensibly. However, having folders in the repository named after each developer with (presumably) very similar source code in them sounds a little suspect - you would typically use branches to deal with divergent versions of the same code.

提交回复
热议问题