Skip to content

git diff <local branch> <remote>/<remote branch> possible using gitpython ? #1148

Answered by hcheruku
hcheruku asked this question in Q&A
Discussion options

You must be logged in to vote

nevermind! I did it.
Here's what I did:

Repo(repo_path).remotes.origin.fetch()
diff = str(Repo(repo_path).git.diff('origin/master')).splitlines()
if len(diff) != 0:
    Repo(repo_path).remote().pull(branch)

It works!
Thanks for replying
Have a great day ahead :-)

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #989 on February 26, 2021 11:18.