0

I have forked github repository to my github account and cloned to my local machine, whenever I want to execute my tool written in python, I need to make sure that my local copy [it may be on master or any other branch] is exactly same as what is there in the original repository master branch,

in the below example the remote details original repo is mk and my forked repo is origin.

$ git remote -v
mk  git@github.com:mediak/meditool.git (fetch)
mk  git@github.com:mediak/meditool.git (push)
origin  git@github.com:seban/meditool.git (fetch)
origin  git@github.com:seban/meditool.git (push)

I want to check the below using python script, if it is exactly matching then ok, otherwise stop executing the script.

git diff mk/master .

  • What have you tried? It is important to say that in the description. – Diogenis Siganos Apr 10 '20 at 07:26
  • I'm also not clear on " I need to make sure that my local copy [it may be on master or any other branch] is exactly same as what is there in the original repository master branch," - does this mean you want to assert that the current branch _contains_ the latest commit from the remote master branch? "Exactly same" would mean that you're on the same commit, which may not be correct if you're on a different branch. – Brendan Forster Apr 11 '20 at 15:06
  • @BrendanForster Thanks for your response, yes, my requirement is to make sure that my local files [cloned from my forked repository] is exactly matching with the same contents present in the remote [mk in my case] repository master branch. – user3365592 Apr 13 '20 at 07:10

0 Answers0