MLi*_*ter 3 git github git-push
在我的本地计算机上,我有一个存储库设置如下
* remote origin
Fetch URL: git@github.com:me/my_project.git
Push URL: git@github.com:me/my_project.git
HEAD branch: master
Remote branches:
mac-master tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (local out of date)
Run Code Online (Sandbox Code Playgroud)
本地只有master分支,我想总是将我的本地主服务器推送到远程分支.我应该这样做: mac-master
git push origin master:mac-master
Run Code Online (Sandbox Code Playgroud)
每次我需要推?如果没有,这样做的正确方法是什么?
如果您一直想这样做,请运行
$ git push -u remote master:mac-master
Run Code Online (Sandbox Code Playgroud)
一次.该-u标志将设置选项,以便随后您可以执行以下操作:
$ git push
Run Code Online (Sandbox Code Playgroud)
推master来mac-master的remote.
您可以通过以下方式更改分支跟踪的远程分支:
git branch --set-upstream branch_name your_remote/other_branch_name
Run Code Online (Sandbox Code Playgroud)
通过这种方式,推动中branch_name以your_remote将做other_branch_name.
| 归档时间: |
|
| 查看次数: |
1964 次 |
| 最近记录: |