Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to run set-branches#1386

Unanswered
dsharma522 asked this question inQ&A
Discussion options

what will be the equivalent ofgit remote set-branches origin --add master8 in GitPython?

Is itrepo.git.remote('set-branches', 'origin', '--add', 'master4')

You must be logged in to vote

Replies: 1 comment

Comment options

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 gitrepo = 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]
You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@dsharma522@briantoby

[8]ページ先頭

©2009-2025 Movatter.jp