I'm trying to update a git repositories origin with Ansible. The command I'm trying to mimic is git remote set-url origin new.git.url/here. Does anyone know how I can accomplish this? I'm trying to do it without recloning the repository.
I'm trying to update a git repositories origin with Ansible. The command I'm trying to mimic is git remote set-url origin new.git.url/here. Does anyone know how I can accomplish this? I'm trying to do it without recloning the repository.
See git_config. For example, given the Git repository test.git
shell> git init --bare test.git
The playbook below does the job
- hosts: localhost
tasks:
- git_config:
repo: 'test.git'
scope: 'local'
name: 'remote.origin.url'
value: 'new.git.url/here'
shell> cd test.git && git config remote.origin.url
new.git.url/here