How to do it...

Now, let's create a new repository from the bundle file we just created. We can do that with the git clone command and by specifying the URL to the remote repository as the path to the bundle. We'll see how to do that in the following code snippet:

$ cd ..
$ git clone -b master Git-Version-Control-Cookbook-Second-Edition_offline-sharing/myrepo.bundle offline-other
Cloning into 'offline-other'...
Receiving objects: 100% (12/12), done.
Resolving deltas: 100% (1/1), done.
Checking connectivity... done.

The new repository is created in the offline-other folder. Let's check the history of that repository by using the following command:

$ cd offline-other
$ git log --oneline --decorate --all
1e42a2d (HEAD, origin/master, master) ...

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.