How to make USB pendrive as a Git Repository?

11.7k Views Asked by At

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?

2

There are 2 best solutions below

3
On

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.

2
On

Every git project is a repository, from which you can push, pull ecc. So you can create the repository wherever you want. You can incorporate every kind of file. Take care of repository size, because these binary files have not little size, generally speaking. If the pendrive became full, you can simply copy the repository to another drive that have enough space and use that.