[英]view the git repository on remote linux server -> in Windows?
[英]Backing up full remote git repository with history to another remote server
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.我想将我的完整存储库myProduct
交付给git.myclient.com/alice/myProduct
,因为 Alice 是我的联系人。
我可以直接执行此操作而无需绕过计算机上的本地存储库吗?
由于我在远程工作,而且mycompany.com
的上行速度比我自己的快很多...
详细来说,我电脑上的弯路如下:
git.myclient.com
创建一个名为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?
就我而言,结果只是https://git.mycompany.com/b--rian/myProduct.git
git remote set-url origin git@git.myclient.com:alice/myProduct.git
将此配置更改为目标存储库。ssh-keygen -o
为 ssh 生成一个键值对,请参阅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-agentgit push --all origin
将大部分内容推送到客户端。 这是我想加快的缓慢步骤。git push origin --tags
,请参阅如何使用 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
.有没有更简单的方法?
也许您可以在git.myclient.com
上使用 Git 镜像。
这取决于客户 VCS (Git)。 大多数实现都有镜像选项。
For example, if the client is using Gitlab: https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html
我认为添加第二个遥控器会更简单......然后推入那个遥控器:
git remote add second url-to-new-repo
git push second master develop # push master and develop to second
等等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.