Getting the difference between two repositories

后端 未结 11 1200
梦如初夏
梦如初夏 2020-11-30 16:33

How can we get the difference between two git repositories?

The scenario: We have a repo_a and repo_b. The latter was created as a copy of repo_a. There have been pa

11条回答
  •  粉色の甜心
    2020-11-30 17:05

    You can add other repo first as a remote to your current repo:

    git remote add other_name PATH_TO_OTHER_REPO
    

    then fetch brach from that remote:

    git fetch other_name branch_name:branch_name
    

    this creates that branch as a new branch in your current repo, then you can diff that branch with any of your branches, for example, to compare current branch against new branch(branch_name):

    git diff branch_name
    

提交回复
热议问题