def fetch_lingbib(): info("Fetching updates from remote 'lingbib'...") try: git.fetch(REMOTE_LINGBIB) except sh.ErrorReturnCode as e: error("Unable to fetch updates.") else: info("Up to date.")
def set_branch_master_tracking(): """Set branch 'master' to track remote 'personal'. Should only be called if the URL for 'personal' is set. """ if branch_master_tracking_personal(): info("Branch 'master' already tracking 'personal'.") else: try: # start by fetching, since Git won't set the upstream repo # for a branch if there isn't a local copy yet git.fetch("personal") git.branch("--set-upstream-to", REMOTE_PERSONAL_MASTER, "master") except sh.ErrorReturnCode as e: gitout(e.stderr) error("Unable to set tracking for branch 'master'." " Please fix any Git problems and try again.") exit(1) else: info("Master branch set to track personal repo.")