-
-
Notifications
You must be signed in to change notification settings - Fork 954
Wrong association between commit and repository #1595
-
I'm using GitPython to pull all commits of a repository.
I don't understand why the commits shared between two branches belong to the last generated branch (which contains these commits) and not to the original branch.
For example, I have a repository with a master branch from which they originate a branch named branch2. When I fetch the commits via repo.iter_commits('--all', reverse=True)
I have the rev_name
of the shared commits as branch2 and not master as I would have expected (branch where the commits were originally created).
Is there a way to get the original branch name?
Of course, I can't check whether the branch name is master, because any other branch creations would have the same problem.
EDIT:
I encountered an additional problem, if there are tags to some commits of the repository, they are used as "branch names". How to fix?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
It's hard to understand what's going on here and probably out of the scope of GitPython. From what I see, those questions are more related to what git
does, which is always used under the hood here as well. I recommend to take a look at the underlying git commands and explore what's happening by invoking git commands directly.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1