从 git 服务器局域网内的计算机上的任何存储库中提取任何分支。
然而,在任何远程计算机上(与 git 服务器不在同一个 LAN 上),从任何存储库中 pull master 都可以,但是 pull 任何其他分支挂起。
环境:
- Git 服务器在 ubuntu 上运行 gitorious
- 我正在使用 msysgit 和命令行或 tortoisegit 从 Windows 中提取
- 使用的 url 格式为:ssh://git@[my.domain]/[proj]/[repo.git]
我知道gitorious does not support branch specific permissions .此外,在 LAN 内所有分支机构都工作的事实必须表明某种东西......它可能是什么?!
更新:
我怀疑我要 pull 的分支不存在,所以我试着推它。结果如下:
git.exe push --progress "origin" other_branch
To ssh://git@my.domain/proj/repo.git
! [rejected] other_branch -> other_branch (non-fast-forward)
error: failed to push some refs to 'ssh://git@my.domain/proj/repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
有趣的是不挂...
最佳答案
首先检查该分支是否存在于 gitorious webview 中,或者您服务器的文件系统中。
如果存在,试试
$git pull --rebase origin other_branch
然后
$git push origin other_branch
关于git pull 仅适用于 master 分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13818689/