连接本地回购与远程回购 [英] connect local repo with remote repo
本文介绍了连接本地回购与远程回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个本地回购。我创建了整个应用程序,但现在我想把它推到远程回购。我已经有远程回购了。如何连接这两个回购站而不会丢失我所做的任何工作?
远程添加源< remote_repo_url>git push - 全部来源
如果您想将所有分支设置为自动在使用 git pull
,将 - set-upstream
添加到推送时使用此远程仓库:
git push --all --set-upstream origin
I have a local repo. I created the whole app but now I want to push it to remote repo. I already have remote repo as well. How can I connect these two repos without losing any work that I did?
解决方案
git remote add origin <remote_repo_url>
git push --all origin
If you want to set all of your branches to automatically use this remote repo when you use git pull
, add --set-upstream
to the push:
git push --all --set-upstream origin
这篇关于连接本地回购与远程回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文