简体   繁体   English

--set-upstream track /从分支名称中使用正斜杠“/”从远程拉出一个新分支

[英]--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.

相关问题 将默认远程的“git pull”配置为同名的原始分支(不带 --set-upstream) - Configure "git pull" for default remote as origin branch of same name (without --set-upstream) 如何在没有--set-upstream的情况下推送远程服务器上不存在的新分支? - How to push a new branch non-existing on the remote server without --set-upstream? git 中的新分支默认跳过 --set-upstream - skipping --set-upstream by default for new branch in git 与git branch相反--set-upstream - Opposite of git branch --set-upstream 要推送当前分支并将远程设置为上游,请使用 git push --set-upstream origin master - To push the current branch and set the remote as upstream, use git push --set-upstream origin master 创建新的 git 分支并跟踪或设置新分支的上游 - Create new git branch and track or set upstream the new branch “git push --set-upstream origin name/of/my/branch”是否存储中间分支? - Does “git push --set-upstream origin name/of/my/branch” store intermediary branches? 为什么我必须在本地创建新分支的上游? - why do I have to set-upstream of new branch I create locally? 如何将上游分支设置为与分支相同的名称 - How to set upstream branch to the same name as the branch 如何设置git分支以推送到具有不同分支名称的远程并从完全不同的url中提取 - How to set a git branch to push to a remote with a different branch name and pull from completely different url
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM