Creating Git bundles
Another method for sharing repository history between repositories is to use the git bundle
command. A Git bundle is a series of commits that can work as a remote repository, but without having the full history of a repository included in the bundle.
Getting ready
We'll use a fresh clone of the offline-sharing
repository, as follows:
$ git clone https://github.com/PacktPublishing/Git-Version-Control-Cookbook-Second-Edition_offline-sharing.git $ cd Git-Version-Control-Cookbook-Second-Edition_offline-sharing $ git checkout master
How to do it...
First, we'll create a root bundle, as shown in the following command, so that the history in the bundle forms a complete history and the initial commit is also included:
$ git bundle create myrepo.bundle master
Counting objects: 12, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (12/12), 1.88 KiB | 0 bytes/s, done.
Total 12 (delta 1), reused 0 (delta 0)
Â
Â
Â
Â
We can verify the...