Quantcast
Channel: Using GitPython module to get remote HEAD branch - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Philip Gaudreau for Using GitPython module to get remote HEAD branch

next(ref for ref in repo.remotes.origin.refs if ref.name == "origin/HEAD").ref.namerepo.remotes.origin.refs will give you a list of the remote branches. Filter on the one that is the HEAD and check...

View Article


Answer by Mark Riggins for Using GitPython module to get remote HEAD branch

To print the current branch:print(repo.head.ref)To list branchesprint [str(b) for b in repo.heads]To checkout a branchrepo.heads[branch].checkout()or repo.git.checkout(branch)If you're trying to delete...

View Article


Answer by moisesvega for Using GitPython module to get remote HEAD branch

I just saw your question I was wondering about this gitPython, looks like really nice tool, and I was looking for this specific question in the GitPython documentation with no lucky but if you search...

View Article

Using GitPython module to get remote HEAD branch

I'm trying to use GitPython to write some Python scripts which I can use it to simplify my daily tasks as I manage many branches.I'm also quite new for Python when it comes to writing complicated...

View Article
Browsing latest articles
Browse All 4 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>