Assume that I have to GIT servers behind a fence, say at git.mycompany.com
(with gitea UI) and at git.myclient.com
(with github-like UI), both heavily security with VPN, multi factor-authentication etc. I want to deliver my full repository myProduct
to git.myclient.com/alice/myProduct
since Alice is my point of contact.
Can I do that directly without the detour over a local repository on my computer?
Since I am working remote, and the uplink of mycompany.com
is much faster than my own...
In detail, the detour over my computer looks as follows:
git.myclient.com
called myProduct
.git pull
. Check my current remote origin with git config --get remote.origin.url
, see eg an answer to How can I determine the URL that a local Git repository was originally cloned from?
In my case, the result simply is https://git.mycompany.com/b--rian/myProduct.git
git remote set-url origin git@git.myclient.com:alice/myProduct.git
.ssh-keygen -o
, see https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Keyeval $(ssh-agent -s)
inside the GIT Bash, see https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent git push --all origin
. This is the slow step which I would like to speed up.git push origin --tags
, see How do you push a tag to a remote repository using Git?remote.origin.url
to back what it was in step 3, in my case it is a git remote set-url origin https://git.mycompany.com/b--rian/myProduct.git
. Is there an easier way?
Maybe you could use Git mirroring on git.myclient.com
.
It's up to clients VCS (Git). Most implementations have mirroring options.
For example, if the client is using Gitlab: https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html
I think it would be much simpler to add a second remote... and then push into that remote:
git remote add second url-to-new-repo
git push second master develop # push master and develop to second
And so on.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.