How to use Ansible git module to pull a branch with local changes?

The git workspace "→ is dirty, there are some local modifications. When I use the command git pull origin master, it works fine, because there is no conflict.

But when I try to use Ansibleas git: repo=xxxx dest=xxx version={{branch}} I received an error:

Local modifications exist in the repository (force = no)

If I add force=yes, I will lose local modifications.

What can I do to save local changes and fetch the latest commit from git using the Ansible git module.

+4
source share
1 answer

You cannot achieve this with the git module.

:

git status --porcelain

, , force true.

+5

Source: https://habr.com/ru/post/1663915/


All Articles