Python 3.x 如何使用--无ff——无提交“;合并时使用GitPython?

Python 3.x 如何使用--无ff——无提交“;合并时使用GitPython?,python-3.x,gitpython,Python 3.x,Gitpython,当我使用命令行git merge和--no ff--no commit时,效果很好。但是使用GitPython,我无法执行dos 可能是我没有找到正确的文档或论坛,用于使用GitPython执行以下等效操作 我有没有失踪 命令行: git merge --no-ff --no-commit "<TAG Name> or <Feature branch>" Python给出了以下错误 cmdline: git merge --no-ff --no-co

当我使用命令行git merge和--no ff--no commit时,效果很好。但是使用GitPython,我无法执行dos

可能是我没有找到正确的文档或论坛,用于使用GitPython执行以下等效操作

我有没有失踪

命令行:

git merge --no-ff --no-commit "<TAG Name> or <Feature branch>"
Python给出了以下错误

cmdline: git merge --no-ff --no-commit test_tag
stderr: 'error: unknown option `no-ff --no-commit test_tag'
usage: git merge [<options>] [<commit>...]
or: git merge --abort
or: git merge --continue

-n                    do not show a diffstat at the end of the merge
--stat                show a diffstat at the end of the merge
--summary             (synonym to --stat)
--log[=<n>]           add (at most <n>) entries from shortlog to merge commit message
--squash              create a single commit instead of doing a merge
--commit              perform a commit if the merge succeeds (default)
-e, --edit            edit message before committing
--cleanup <mode>      how to strip spaces and #comments from message
--ff                  allow fast-forward (default)
--ff-only             abort if fast-forward is not possible
--rerere-autoupdate   update the index with reused conflict resolution if possible
--verify-signatures   verify that the named commit has a valid GPG signature
-s, --strategy <strategy>
                      merge strategy to use
-X, --strategy-option <option=value>
                      option for selected merge strategy
-m, --message <message>
                      merge commit message (for a non-fast-forward merge)
-F, --file <path>     read message from file
-v, --verbose         be more verbose
-q, --quiet           be more quiet
--abort               abort the current in-progress merge
--quit                --abort but leave index and working tree alone
--continue            continue the current in-progress merge
--allow-unrelated-histories
                      allow merging unrelated histories
--progress            force progress reporting
-S, --gpg-sign[=<key-id>]
                      GPG sign commit
--overwrite-ignore    update ignored files (default)
--signoff             add Signed-off-by:
--verify              verify commit-msg hook
cmdline:git merge--no ff--no commit test_标记
stderr:'错误:未知选项'no ff--no commit test_标记'
用法:git merge[][…]
或者:git merge--中止
或者:git merge--继续
-n在合并结束时不显示diffstat
--stat在合并结束时显示diffstat
--摘要(与--stat同义)
--日志[=]添加(最多)来自shortlog的条目以合并提交消息
--挤压创建单个提交,而不是执行合并
--提交合并成功时执行提交(默认)
-e、 --提交前编辑消息
--清理如何从消息中删除空格和#注释
--ff允许快进(默认)
--ff仅在无法快进时中止
--如果可能,请重新使用重复使用的冲突解决方案自动更新索引
--验证签名验证指定的提交是否具有有效的GPG签名
-s、 --战略
要使用的合并策略
-十、 --战略选择
所选合并策略的选项
-m、 --讯息
合并提交消息(对于非快进合并)
-F、 --文件从文件中读取消息
-v、 ——冗长,更冗长
-q、 ——安静点,安静点
--中止当前正在进行的合并
--quit--中止,但不使用索引和工作树
--继续当前正在进行的合并
--允许不相关的历史记录
允许合并不相关的历史记录
--进度部队进度报告
-S、 --gpg符号[=]
GPG签名提交
--覆盖忽略更新忽略的文件(默认)
--签核添加签核人:
--验证提交消息钩子
这应该行得通

git.merge('args', no_ff=True)
用您的参数(如分支)替换“args”

git.merge('args', no_ff=True)