4

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?

Micha Wiedenmann
  • 19,979
  • 21
  • 92
  • 137

2 Answers2

6

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • If add add audio,video files into the repo is the quality of the audio,video gets compressed or Not? –  Dec 17 '13 at 09:12
  • @VINAYAK the quality won't change, but a git repo is the wrong referential for that kind of file. – VonC Dec 17 '13 at 09:12
  • 1
    +1 I second this approach. I also tried it the other way round - origin on harddrive, clone on USB - but that led to "cd: .git: No such file or directory" errors under Windows (http://stackoverflow.com/q/11539076/127465) when pulling on the key. The other way (origin on USB) works fine pulling/pushing from/to the key. You can also have a checked-out workspace on the USB (but then need to set receive.denyCurrentBranch). – ThomasH May 23 '14 at 15:53
1

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.

Jepessen
  • 11,744
  • 14
  • 82
  • 149
  • Can we improve the storage space of Pendrive by creating Repositary in The PENdrive? –  Dec 17 '13 at 09:10
  • I don't understand what you want to say (my bad english). What do you mean with "improve the storage space of Pendrive"? you can optimize repository size using `git gc`, `git gc --aggressive` in order to save some space. – Jepessen Jan 29 '14 at 15:38