I do not want to get each branch from the source, because there are many of them. I just want to track multiple (e.g. master ) and my branches (organized in the my_name subdirectory). I can do the following:
$ git fetch origin refs/heads/my_name/*:refs/remotes/origin/my_name/* refs/heads/master:refs/remotes/origin/master refs/heads/some_branch:refs/remotes/origin/some_branch
I want the above "set" of refspecs to be the default git fetch . I tried
$ git config remote.origin.fetch refs/heads/my_name/*:refs/remotes/origin/my_name/* $ git config --add remote.origin.fetch refs/heads/master:refs/remotes/origin/master
Fails:
$ git config remote.origin.fetch refs/heads/my_name/*:refs/remotes/origin/my_name/* error: More than one value for the key remote.origin.fetch: refs/heads/master:refs/remotes/origin/master
I also try the following, but this also fails:
$ git config remote.origin.fetch 'refs/heads/my_name/*:refs/remotes/origin/my_name/* refs/heads/master:refs/remotes/origin/master refs/heads/some_branch:refs/remotes/origin/some_branch' $ git fetch fatal: Invalid refspec 'refs/heads/my_name/*:refs/remotes/origin/my_name/* refs/heads/master:refs/remotes/origin/master refs/heads/some_branch:refs/remotes/origin/some_branch'
Note: Git 1.7.11
git
user716468 Mar 19 '13 at 18:10 2013-03-19 18:10
source share