Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git 将 local branch 与 remote branch 关联 #155

Closed
Dream4ever opened this issue Jun 24, 2021 · 0 comments
Closed

Git 将 local branch 与 remote branch 关联 #155

Dream4ever opened this issue Jun 24, 2021 · 0 comments
Labels

Comments

@Dream4ever
Copy link
Owner

在本地开发的项目,最开始是上传到 gitee 上的。后来想要充分利用 GitHub 的各项功能,于是又把它上传到了 GitHub 上面,并删掉了 gitee 上的项目,同时在本地也删掉了 gitee 这个 remote。

但是该项目同时运行在阿里云服务器上,删掉了服务器上该项目的 gitee 的 remote 之后,还需要把服务器上的项目也和 GitHub 仓库关联上,执行如下代码即可:

$ git branch --set-upstream-to=origin/main main

这样就可以很方便地执行 git pullgit push 之类的命令了,而不需要执行 git pull remoteOriginUrl 这样繁琐的命令了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant