Elt*_*tos 2 git branch github remote-branch git-branch
当我执行命令时:
git branch -r,它只是显示:
origin/HEAD -> origin/master
origin/development-elton
origin/master
Run Code Online (Sandbox Code Playgroud)
当执行命令时:
git remote show origin,它显示:
remote origin
Fetch URL: git@bitbucket.org:r2a_/grconsig.git
Push URL: git@bitbucket.org:r2a_/grconsig.git
HEAD branch: master
Remote branches:
caio-dev new (next fetch will store in remotes/origin)
controle-usuario new (next fetch will store in remotes/origin)
development-elton tracked
master tracked
rails-admin new (next fetch will store in remotes/origin)
**refinancy new (next fetch will store in remotes/origin)**
Run Code Online (Sandbox Code Playgroud)
如何为我的本地提取分支再融资?
如果现有答案不够,您可以检查您的.git/config文件。就我而言,我有以下部分:
[remote "origin"]
url = https://github.com/John/project1
fetch = +refs/heads/master:refs/remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
我已将文件编辑为:
[remote "origin"]
url = https://github.com/John/project1
fetch = +refs/heads/*:refs/remotes/origin/*
Run Code Online (Sandbox Code Playgroud)
然后,我能够使用git fetch.
如果您使用以下命令更改远程存储库,有时会发生这种情况:
git remote set-url origin https://github.com/John/project1
Run Code Online (Sandbox Code Playgroud)
扩展mipadi 的答案:
要查看所有远程分支(使用单个远程分支):
git fetch
git branch -r
Run Code Online (Sandbox Code Playgroud)
要查看所有远程分支(具有多个远程):
git remote -v //shows names and URLs of remotes
git fetch --all
git branch -r
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1832 次 |
| 最近记录: |