How to do it...

  1. One of the differences between a normal repository and a bare or mirror one is that there are no remote branches in a bare repository. All the branches are created locally. We can see this in the three repositories by listing the branches with the git branch command as follows:
$ cd jgit 
$ git branch 
* master 
$ cd ../jgit.git # or cd ../jgit.mirror 
$ git branch 
* master 
  stable-0.10 
  stable-0.11 
  stable-0.12 
... 
  1. To see the difference between the bare and mirror repositories, we need to list the different refspecs fetches and the different refs namespaces. List the fetch refspec of origin in the mirror repository (jgit.mirror):
$ cd ../jgit.mirror$ git config remote.origin.fetch 
+refs/*:refs/* 
  1. List the different refs ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.