Dropbox and Git work together

I know that there are similar questions - this is one of my most similar: Effectively use Git and Dropbox?

My question is: I started using Git to save versions of my school information. Suppose I have a GradSchool folder where I save my resume.doc and SoP.doc. This folder is in my Dropbox folder as I use dropbox for backup. Dropbox has a “version”, but it’s not so great, so I want to better track versions of it. So

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

But now that means that I have a .git folder that is "pushed" into my Dropbox every time it changes, along with the documents in the folder. If I changed branches on my machine, will it now remove the package to synchronize this version with its servers and my other machines?

Is this the wrong way to do this? The other SO question linked above had a different workflow, but it also did not save the project files in the Dropbox folder for backup. He also mentioned the creation of a “bare” repo for pushing. What is a bare repo? (in a simple way because I'm new to this). Any help on how I should change my workflow would be great!

Thanks!

+4
source share
2 answers

I use Git and Dropbox for a lot of code, which I want to keep easily accessible on multiple computers. Different content, but the same idea. I save my .git folder in the Dropbox folder. Since everything is very compressed, in fact it does not take up much space. If synchronization does not bother you, I would say that this is not a problem. It never caused me any heartache, and I had at least 4-5 projects stored in this way.

+4
source

You can create two separate repo objects: 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 that may interest you that shows you how to set up a bare repo.

Use git and Dropbox efficiently?

+3
source

All Articles