How to make USB pendrive as a Git Repository?

user3073914 picture user3073914 · Dec 17, 2013 · Viewed 10.5k times · Source

I want to make USB Pendrive as a Git repository for gathering information.

Suppose if we make our Pen drive as a Git repository: Can we incorporate audio, video files in it?

Answer

VonC picture VonC · Dec 17, 2013

The best practice is to create a bare git repo directly in your USB key, and consider that repo as your remote repo.

cd /path/to/your/usb/key
git init --bare myrepo
ls myrepo.git

That means you are cloning/pulling from that repo onto your local harddrive, and you are pushing back to the bare repo on your USB key.

Note that myrepo.git folder on said key, which contains your bare repo, don't change the nature of that key.
You can still copy any other file (audio, video, ...) you want on that key, outside of the myrepo.git folder.
I wouldn't recommend pushing to that repo binary files (audio, video, ...) though, as that would make any clone quite cumbersome because of the size of the repo.