If I switch to the other branch using GitHub Desktop, then it returns two heads. If I switch back to master again, it also shows two heads.
\n
Is there a way to show all the heads at the beginning to avoid this manual work? For example, if I have 10 branches, i don't want to manually switch the branches 10 times to get them into Repo.heads.
\nThanks.
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I believe what's at display here is a 'smart' feature implemented specifically to list local branches as well as remote branches. This explains why GitPython sees these as heads only after they have been checked out once, after all, this would create a local tracking branch.
\nIn order to emulate this feature, one would have to look at remote branches as well.
\nI am closing this issue as Q&A, please feel free to keep posting here with follow ups as you see fit.
-
Beta Was this translation helpful? Give feedback.
-
I believe what's at display here is a 'smart' feature implemented specifically to list local branches as well as remote branches. This explains why GitPython sees these as heads only after they have been checked out once, after all, this would create a local tracking branch. In order to emulate this feature, one would have to look at remote branches as well. |
Beta Was this translation helpful? Give feedback.
I believe what's at display here is a 'smart' feature implemented specifically to list local branches as well as remote branches. This explains why GitPython sees these as heads only after they have been checked out once, after all, this would create a local tracking branch.
In order to emulate this feature, one would have to look at remote branches as well.
I am closing this issue as Q&A, please feel free to keep posting here with follow ups as you see fit.