python - How to get count of unpublished commit with GitPython? -


with git status can information count of unpublished commits:

» git status              # on branch master # branch ahead of 'origin/master' 2 commits. #   (use "git push" publish local commits) # nothing commit, working directory clean 

i want unpublished commits (or count) gitpython. docs found repo.git.status(), not want.

the command looking is:

repo.iter_commits('branch..branch@{u}') 

or if want list:

list(repo.iter_commits('branch..branch@{u}')) 

the branch@{u} syntax refers upstream branch of branch.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -