in Education by
My 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'm trying to use Ansible like git: repo=xxxx dest=xxx version={{branch}} I got error Local modifications exist in repository (force=no) If I add force=yes, then I will lose my local modifications. What can I do to keep my local changes and pull the latest commit from git by using the Ansible git module? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
You cannot use this in the git module because ansible will check the results of git status --porcelain And abort this task execution If there are any local changes in tracked files The only way is using shell command or tries to keep a clean workspace. Because there is no other module that will execute git pull and git module will not allow this execution. For more information please go through the following tutorial to get more info about git:

Related questions

0 votes
    I'm just getting my feet wet with Ansible 2.2 and Devops and I've run into the following problem. I have a ... . How to fix this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am new at using Ansible. I tried to create directories and download files using Ansible. Should I use shell ... module is available? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    If I have to build an infrastructure stack in the cloud using a tool like Ansible. Is it necessary to have the ... the best to use? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I don't want to rename a remote branch, as described in the Rename master branch for both local and remote ... and remote branch name Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I have a project consisting of a huge amount of data. Because of its size, I can't use a remote GIT repo and push/pull ... -ProjectGit | | |-objects |-project1 | |-refs | |-.git...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I have a playbook that looks like the following. It is supposed to install python onto the remote machine ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I created a local branch that I want to 'push' upstream. There is a similar question here on Stack ... the upstream repository? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How do I discard changes in my working copy that are not in the index? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    How can we make ignore file mode (chmod) changes in git?...
asked Jan 8, 2021 by JackTerrance
0 votes
    I would like to know how to delete a commit. By delete, I mean it is as if I didn't make that commit, ... -hard HEAD. Is this correct? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, ... those forks I pulled? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How do you delete untracked local files from your current working tree? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I have created a branch named dev. I have done a pull request to send dev code to master, when I do ... to resolve these conflicts. Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git ... for a single project. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I staged a few changes to be committed; how can I see the diff of all files which are staged for the next ... an alias for, right? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...