我正在尝试将我的功能分支 rebase 到主分支。但是,当我尝试使用 git pull 或获取时,它甚至没有将 master 分支从远程 pull 到本地。
这是我尝试过的步骤
$ git merge origin/master
merge: origin/master - not something we can merge
$ git merge master
merge: master - not something we can merge
$ git branch -r
origin/feature
git branch -a
* feature
remotes/origin/feature
$ git fetch --all
Fetching origin
$ git pull --all
Fetching origin
Already up to date.
我通过以下方式克隆
git clone https://github.optum.com/<Repo details> --branch feature --single-branch
最佳答案
这是由于您使用 --single-branch
克隆的事实引起的,此更改器存储库配置将所有命令范围限制到远程的特定分支。 You can undo the command or add another branch as explained here .
git remote set-branches --add origin [remote-branch]
git fetch origin [remote-branch]:[local-branch]
关于git - 主分支无法使用 Git 从远程 pull ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58990860/