[英]Gitpython merge replacing the code in master from the merged branch
我正在嘗試使用gitpy來合並兩個分支。為了測試它我保留了一個單獨的文件main.py,在兩個分支master和release中使用不同的代碼。最后我將release分支合並到master.A合並操作后的代碼在master分支中剛剛被發布分支中的代碼替換。
main.py(主)
import os
main.py(釋放)
import git
Merge.py(代碼段)
repo = git.Repo.clone_from(HTTPS_REMOTE_URL, DEST_NAME)
repo.git.checkout('release')
repo.git.checkout('master')
repo.git.merge('release')
main.py(碩士預期)
import os
import git
main.py(主 - 實際)
import git
由於合並不起作用,還有另一個問題。上面的代碼可以很好地將一個分支合並到另一個分支上。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.