from git import Repo import os def getlibreticmenuBranch(): repo = Repo(os.getcwd()) branch = repo.active_branch return branch.name def setlibreticmenuBranch(branch): repo = Repo(os.getcwd()) git = repo.git git.switch(branch)