Gitpython: How to just merge?

Created on 8 Feb 2017  路  1Comment  路  Source: gitpython-developers/GitPython

Hello. I have a silly question, but how ffs just merge two branches like 'git merge branch --no-ff'

i've tried something like this from tests:

# # prepare a merge
master = repo.heads.master  # right-hand side is ahead of us, in the future
# # FROM MERGE!
merge_base = repo.merge_base(repo.branches['branch'], master)  # allwos for a three-way merge
repo.index.merge_tree(repo.branches['branch'], base=merge_base)
repo.index.commit("AutoMerge Commit", parent_commits=(repo.branches['branch'].commit, master.commit))

but after this i got very strange log history. i have commits from 'branch', but changes only from master. Please help me

Q&A

Most helpful comment

GitPython provides many capabilities, but does so on a lower level. Therefore sometimes it is best to simply use the git program to do the high-level work: repo.git.merge('branch-to-merge').

>All comments

GitPython provides many capabilities, but does so on a lower level. Therefore sometimes it is best to simply use the git program to do the high-level work: repo.git.merge('branch-to-merge').

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sp-ricard-valverde picture sp-ricard-valverde  路  3Comments

radujipa picture radujipa  路  3Comments

marcwebbie picture marcwebbie  路  6Comments

johnlinp picture johnlinp  路  6Comments

tucked picture tucked  路  5Comments