I have a Jenkins project which has a git checkout url. The Jenkins master is configured with git-Jenkins plugin version 2.2.10_2 (https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin).
I wanted to check if there is any way to provide different git remotes for fetch and push.
e.g: $ git remote -v
origin git@<read-only-git>.com:org/repo.git (fetch)
origin git@<read-write-git>.com:org/repo.git (push)
The use case here is to use a read only source for clones and push any changes back to a read-write source. There is an external synchronization mechanism to update the read only copy.
Thank you,
-Mayur
Use the --push option of git remote set-url.
Assuming you'd cloned from the read-only repo:
Before
$ git remote -v
origin git@<read-only-git>.com:org/repo.git (fetch)
origin git@<read-only-git>.com:org/repo.git (push)
Command
git remote set-url --push origin git@<read-write-git>.com:org/repo.git
After
$ git remote -v
origin git@<read-only-git>.com:org/repo.git (fetch)
origin git@<read-write-git>.com:org/repo.git (push)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With