Git 推送到另一个远程存储库
假设我有一个本地存储库a,也可以访问远程存储库B。这些存储库是完全不同的!我想推送所有文件/提交等。。。从A到B存储库。 因此,我执行了以下git命令:Git 推送到另一个远程存储库,git,push,git-remote,Git,Push,Git Remote,假设我有一个本地存储库a,也可以访问远程存储库B。这些存储库是完全不同的!我想推送所有文件/提交等。。。从A到B存储库。 因此,我执行了以下git命令: git远程添加源站 git推送原始主机 我得到了以下错误: hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository p
git远程添加源站
git推送原始主机
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
问题的原因是我不想执行git pull
命令,因为B存储库占用了大量空间(数吨千兆字节!),而a存储库占用了几千字节
有没有办法不用拉就推?在遥控器上创建一个新分支:
git push origin master:my-branch
然后,在远程上,您可能希望将您的工作添加到主分支。一种方法是:
git checkout my-branch
git rebase master
git checkout master
git merge my-branch
在远程服务器上创建新分支:
git push origin master:my-branch
然后,在远程上,您可能希望将您的工作添加到主分支。一种方法是:
git checkout my-branch
git rebase master
git checkout master
git merge my-branch
推送到远程服务器中不存在的分支。(例如,在远程上创建一个新分支)如果您不能“将文件从a推送到B”。提交是所有文件的快照,提交是“推拉”的内容但是这个问题似乎并不是要推到一个远程系统中不存在的分支。(例如,在远程上创建一个新分支)如果您不能“将文件从a推送到B”。提交是所有文件的快照,提交是“推拉”的内容但是这个问题似乎并没有问这个问题谢谢!这就是我需要的谢谢!这就是我需要的