I created a portable development environment off of portable apps and quite a few custom batch files. I would like to keep all instances of it up to date - Dropbox would be an ideal option but I need it to synch on my flash drive and my computer. I think git would work, but the size of the repo will be an issue. I need to know the viability of this idea and how to delete commits to prune extra data when uploading. I think the repo will at least double the total size of the data. Any ideas?
-
svn has `svn export`. I am sure you can find something for git as well. – Ozair Kafray Jun 09 '12 at 10:03
-
http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export – Ozair Kafray Jun 09 '12 at 10:05
-
Git export seems like a good idea, but I will need to commit the changes once I am done working. Git export seems like what it produces isn't a repository, so how would I save? – Waffles Jun 09 '12 at 10:21
-
You will have to export and upload it wherever you need the updated code, but not the repository data. I don't think there is another way to it. You should compare the size of an export vs. a folder with repo to see if it would really matter for you. – Ozair Kafray Jun 09 '12 at 11:03
-
Sure, I will compare. I'm planning to host this on a git server like github. Here is a scenario: I download the code from github to work on a few projects. Now I want to commit the changes to github. If I do git export, it will not copy the repo so I can't use 'git push'. How would I upload the changes? – Waffles Jun 09 '12 at 12:01
-
You work on them and when you are done testing, you can git push and then do a git export for deploying it on a server or your USB. – Ozair Kafray Jun 09 '12 at 12:22
1 Answers
If your files are mostly text, Git will much less than double the size of your data. To take an example, I store my Vim configuration files in a Git repository to allow me to easily get at them anywhere, and keep them up-to-date. The config files themselves are just under 3 MB, and the .git
directory for that is only just over 1 MB after 683 commits. It's smaller than a Subversion checkout, and small enough not to worry about.
It used to be necessary to run git gc
in a repository every so often to prune unreachable data from the repository. This was especially true after doing a lot of rebasing or other history editing. But since about Git 1.5, it keeps track of the amount of unreachable data as you go along and automatically prunes it when it gets to be too much. There are configuration options to tune it if you're really short on space and have time and CPU cycles to spare. See git help gc
for details, but I really think you just won't find space a problem.

- 14,779
- 3
- 46
- 95