GitPython фиксирует проблему - PullRequest
       11

GitPython фиксирует проблему

0 голосов
/ 25 октября 2018

Мне нужно объединить мои ветви с основной веткой, но при попытке сделать коммит с parent_commit выдает некоторые ошибки.

>>> repo.active_branch
<git.Head "refs/heads/bug">

>>> current=repo.active_branch

>>> repo.git.checkout('master')
"Your branch is up to date with 'origin/master'."

>>> master=repo.git.checkout('master')

>>> base=repo.merge_base('master','bug')


>>> repo.index.merge_tree('bug', base=base)
<git.index.base.IndexFile object at 0x1060eff98>


>>> branch_commit=repo.git.checkout('bug')

>>> repo.index.commit('Merged into master',parent_commits=(branch_commit.commit, master.commit))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'commit'
>>> 
...