Skip to content

Instantly share code, notes, and snippets.

@sanmiguel
Created May 31, 2014 22:49
Show Gist options
  • Select an option

  • Save sanmiguel/4c1871780f0f12ac843b to your computer and use it in GitHub Desktop.

Select an option

Save sanmiguel/4c1871780f0f12ac843b to your computer and use it in GitHub Desktop.
import os
import powerline.lib.vcs as plvcs
import pygit2 as git
name = os.getcwd()
repo = git.Repository(name)
branch = repo.lookup_branch(repo.head.shorthand)
upstream = branch.upstream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment