Git Bundle

       Keeping git repositories in sync is usually and easily done using git pull and git push. However, for those rare times when you don't have network connectivity (or limited connectivity) and still needs to transfer the contents of a repository to somewhere else, there's git bundle.


      Another use case, would be like you have hired external contractors to build some application, now you need to get code from them to your organization internal private Git Server hosted and maintained by your organization  and it doesn't exposed to public. So instead of sending .zip format of code, they can send git bundle.


What Git Bundle Covers?
      Git bundle file is a full repository in a single file, you can have branches, commit history, tags, basically everything you expect in a repository, but it's all contained in a single file.This makes sharing the repository or moving the full repository pretty straightforward.

   Now suppose you have a project myproj and you need to send to someone else.
       

        user1@host$ cd myproj
        user1@host$ git bundle create repo-bundle master
       
 

That will make a bundle file (repo-bundle) that contains all the history of the master branch. you can send this file to someone, they just need to clone it just like remote git origin.
       

        user2@host$ git clone repo-bundle myproj
        user2@host$ cd myproj
        user2@host$ git status
        On branch master
        Your branch is up to date with 'origin/master'
       
 

Another thing about git bundle is, if you need to update one, you can send them a incremental file with latest changes.

for more info about git bundle refer here, https://git-scm.com/docs/git-bundle

That's for day, ciao until next time.

Comments

Popular posts from this blog

Avro Secondary Sorting

Builder Design Pattern