[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] ColneCommand won't clone all branches

Hi,

now I see the problem. There is indeed one functionality of git-clone
in native git where jgit behaves differently. See
the following script:

$ git clone http://github.com/chalstrick/mergeExample.git
$ cd mergeExample/
$ git branch
* master
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/side
$ cd ..
$ git clone --bare http://github.com/chalstrick/mergeExample.git
$ cd mergeExample.git/
$ git branch
* master
  side
$ git branch -a
* master
  side

A native git-clone with '--bare' option will not create remote
tracking branches but local branches with the same name as the remote
branches. A native git-clone without '--bare' will create remote
tracking branches for all branches found remotely. Those remote
tracking branches are not listed by 'git-branch' by default. JGit, in
contrast, will always create the remote tracking branches. That can be
easily fixed so that JGit by default also does not create remote
tracking branches on cloning bare repos. I'll propose a fix.

Ciao
  Chris