[英]--set-upstream track/pull a new branch from remote with forward slash “/” in the branch name
I have a branch on my remote which my local repo does not know about. 我的遥控器上有一个分支,我的本地仓库不知道。 I'm trying to create the branch locally, track and pull, but the branch has a forward slash in it's name.
我正在尝试在本地创建分支,跟踪和拉取,但分支的名称中有正斜杠。
My results: 我的结果:
$ git branch --set-upstream feature/users origin/feature/users
fatal: Not a valid object name: 'origin/feature/users'
Do I need to escape the forward slash in the branch name? 我是否需要在分支名称中转义正斜杠? I've tried quotes as well as backslash.
我试过报价和反斜杠。
The upstream branch must be an existing local branch (local in the sense that it exists in your local repo) before it can be set as upstream. 上游分支必须是现有的本地分支(本地存储在本地存储中的本地分支)才能设置为上游。 You should fetch from the remote to get the current
origin/feature/users
before trying to create a local branch that tracks it. 在尝试创建跟踪它的本地分支之前,您应该从远程获取以获取当前的
origin/feature/users
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.