git - 如何将我的远程 git 存储库移动到另一个远程 git 存储库?

标签 git git-remote

我想将我的远程 git 存储库及其所有分支移动到一个新的远程存储库。

旧 Remote = git@github.com:thunderrabbit/thunderrabbit.github.com.git

new remote = git@newhub.example.net:tr/tr.newrepo.git

最佳答案

在本地机器的终端中:

cd ~
git clone <old-remote> unique_local_name
cd unique_local_name

for remote in `git branch -r | grep -v master `; \
do git checkout --track $remote ; done

git remote add neworigin <new-remote>
git push --all neworigin

关于git - 如何将我的远程 git 存储库移动到另一个远程 git 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14432234/

相关文章:

windows - 为什么 Git 命令在 Windows 10 上通过 Win32-OpenSSH 失败?

php - 仅在 git push 后重新验证 opcache

git - 设置Git来管理远程网站

git - 当 git 子模块引用的 repo 被删除时会发生什么?

Git 脑子乱了?

GitHub:我为什么要 fork ?

git - 为什么 GitKraken 图没有按时间顺序显示同一分支的提交?

c# - SSH.NET - 已建立的连接被主机中的软件中止

windows - 如何访问 Windows 共享上的 git 存储库?

amazon-web-services - 带有 git-remote-codecommit 的 AWS CodeCommit