tags:

views:

180

answers:

2

Hello,

I know there are similar questions - this one is the one mine is most like: http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively

My question is: I've started using Git to keep versions of my school information. Lets say, I have a GradSchool folder where I keep my resume.doc and SoP.doc. This folder is IN my dropbox folder, as I use dropbox a backup. Dropbox has "versioning" but it isnt that great, so I want to keep better track of versions of this. So

~: cd ~/Dropbox/GradSchool/
~/Dropbox/GradSchool/: git init
~/Dropbox/GradSchool/: git add .
~/Dropbox/GradSchool/: git commit -a

But now that means I have a .git folder that is being "pushed" to my dropbox every time it changes, along with the documents in the folder. If I change branches on my machine will dropbox now sync that version to its servers and my other machines?

Is this a wrong way of doing this? The different SO question linked above had a different workflow, but it also didnt keep the project files IN the dropbox folder for backup. It also mentioned creating a "bare" repo to push to. What is a "bare" repo? (in easy terms because I am new to this). Any help with how I should modify my workflow would be great!

Thanks!

A: 

I use Git & Dropbox for a lot of code that I want to keep easily accessible across multiple computers. Different content, but the same idea. I keep my .git folder in the Dropbox directory. Because everything is tightly compressed, it doesn't really take up much space. Unless the sync'ing bothers you, I'd say it's not a problem at all. It's never caused me any heartache and I have at least 4-5 projects stored this way.

Rob Wilkerson
Ok so its ok to think about placing my GradSchool folder (which contains the .git directory) inside of my dropbox folder and let dropbox sync everything behind the scenes?
NewImageUser
Thats the idea - you may have problems if you commit from two different machines before Dropbox has a chance to sync. But if there is only one of you that shouldn't be a problem.
Martin Beckett
@NewImageUser: That's what I do. I like being able to code on either without having to worry about committing, pushing or pulling. Sometimes I need to switch machines with updates in a state that I just don't want memorialized by a commit--even if I can rebase it later.
Rob Wilkerson
+1  A: 

You could create two separate repo's, one inside your Dropbox, and the other on your local computer. Then you can work locally on your local repo, and when you are ready to put it on Dropbox you just use git push.

There is another answer you may be interested which shows you how to setup a "bare" repo.

http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively/1961515#1961515

kylef
This is what I do. It makes more sense to me to keep your worktree out of your Dropbox folder, and use Dropbox as a remote.
peterjmag