gpt4 book ai didi

git - 如何使用 Ansible git 模块 pull 带有本地更改的分支?

转载 作者:太空狗 更新时间:2023-10-29 13:10:07 30 4
gpt4 key购买 nike

我的 git workspace 很脏,有一些局部修改。当我使用命令 git pull origin master 时,它工作正常,因为没有冲突。

但是当我尝试使用 Ansiblegit: repo=xxxx dest=xxx version={{branch}}我得到错误:

Local modifications exist in repository (force=no)

如果我添加 force=yes,那么我将丢失本地修改。

如何使用 Ansible git 模块保留本地更改并从 git 中提取最新提交。

最佳答案

您无法使用 git 模块实现它。

Ansible 检查 the result of :

git status --porcelain

aborts task execution如果跟踪文件中有本地更改,除非 force 参数设置为 true

关于git - 如何使用 Ansible git 模块 pull 带有本地更改的分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41178361/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com