-
|
yes (except for the discrepancy between master4 and master8 above), but as I understand things this is only needed after a shallow clone (using --depth). This code snippet shows a way to make all branches available locally: import git
repo = git.Repo('/tmp/g2')
repo.git.remote('set-branches','origin','*')
repo.git.fetch()
branchlist = [i.strip() for i in repo.git.branch('-r').split('\n') if '->' not in i]
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
{{editor}}'s edit
{{editor}}'s edit
Uh oh!
There was an error while loading. Please reload this page.
-
what will be the equivalent of git remote set-branches origin --add master8 in GitPython?
Is it repo.git.remote('set-branches', 'origin', '--add', 'master4')
Beta Was this translation helpful? Give feedback.