我正在尝试使用 Ansible 更新 git 存储库源。我试图模仿的命令是git remote set-url origin new.git.url/here. 有谁知道我怎样才能做到这一点?我试图在不重新克隆存储库的情况下完成此操作。
请参阅git_config。例如,给定 Git 存储库test.git
shell> git init --bare test.git
Run Code Online (Sandbox Code Playgroud)
下面的剧本可以完成这项工作
- hosts: localhost
tasks:
- git_config:
repo: 'test.git'
scope: 'local'
name: 'remote.origin.url'
value: 'new.git.url/here'
Run Code Online (Sandbox Code Playgroud)
shell> cd test.git && git config remote.origin.url
new.git.url/here
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1337 次 |
| 最近记录: |