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...
My current lengthy and slow approach
In detail, the detour over my computer looks as follows:
- Using the (github-like) user-interface, create an empty repository at
git.myclient.com
calledmyProduct
. - Make sure that my local repository is up to date with
git pull
. Check my current remote origin with
git config --get remote.origin.url
, see e.g. 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
- Change this configuration to the destination repository with
git remote set-url origin git@git.myclient.com:alice/myProduct.git
. - Generate a key-value pair for ssh using
ssh-keygen -o
, see https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key - Ask Alice to navigate to Settings > GPG and SSH keys (usually at https://git.myclient.com/settings/keys) and ask her to add my New SSH key from the previous step.
- Make sure that the SSH agent is running on my windows box, if not start it with
eval $(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 - Now, finally, I can push most things to the client using
git push --all origin
. This is the slow step which I would like to speed up. - The tags have to be pushed separately, I heard:
git push origin --tags
, see How do you push a tag to a remote repository using Git? - Wind back everything by setting the
remote.origin.url
to back what it was in step 3, in my case it is agit remote set-url origin https://git.mycompany.com/b--rian/myProduct.git
.
Is there an easier way?