git branch --track and remote branches with / in the name
From: Gerrit Pape <hidden>
Date: 2016-06-15 22:43:14
From: Gerrit Pape <hidden>
Date: 2016-06-15 22:43:14
Hi, the --track option to git branch or git checkout doesn't work for
remote branches that contain a slash in the name:
$ tail -n6 .git/config
[remote "origin"]
url = /tmp/repo
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
$ git branch -r
origin/HEAD
origin/b
origin/foo/b
origin/master
$ git branch --track b origin/b
Branch b set up to track remote branch refs/remotes/origin/b.
$ git branch --track foo/b origin/foo/b
$ tail -n6 .git/config
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "b"]
remote = origin
merge = refs/heads/b
$
Regards, Gerrit.