Hi,
I am cloning a worktree as a bare repo in nodegit
Git.Clone('/work/localrepo', '/git/newbare', {bare: 1})
This creates a bare repo just like
# in /git/newbare
> git clone --bare /work/localrepo
Note: newbare
has refs to all localrepo
branches in /git/newbare/refs/remote/origin
,
but only localrepo's
active branch is cloned in the newbare's
local refs
That means that if localrepo
was on master when it was cloned, then newbare
is only tracking master
Now in git
I can track all branches on origin
with
#in bare
> git fetch origin '+refs/*;refs/*'
>>> /git/newbare
From /work/localrepo
* [new branch] feature -> feature
Look at refspec if you want more info on the fetch here.
Problem
I can't figure out how to setup tracking branches in a bare directory, for all branches on remote/origin
with nodegit