![](/img/trans.png)
[英]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.