Reputation: 42339
So far I've managed my code by keeping it inside my Dropbox folder and nothing more. Lately my code has been growing in size and complexity and I'm wondering if it wouldn't be better to set up a GitHub or Bitbucket account to manage it more efficiently.
I know there are already dozens of questions here regarding all kinds of mixes between Git and Dropbox; this is precisely what got me confused. Some say it's a great idea while others say it's a terrible idea.
I just want to know: if I decide to set up a git repository, using either GitHub or Bitbucket, should I move my .git
folder outside of my Dropbox folder?
Upvotes: 15
Views: 6463
Reputation: 636
I keep all my git folders in Dropbox. My use case is I have a desktop at home, I grab the laptop and keep developing on the laptop, then I get to the office and jump on the desktop there - it is completely seamless and I don't have to worry about any uncommitted work.
The only downside is it causes Dropbox CPU use to go up, so I pause Dropbox when I am on the road to preserve battery life.
Upvotes: 0
Reputation: 1512
In fact, if you are using GitHub or another public Git hosting service, you should not put your Git repository in Dropbox at all. It makes almost no sense (to me, at least) since with GitHub you can already access your code anywhere, as long as you have internet access.
The situation is totally different in your link, which considers that Git on Dropbox is a great idea. Since he uses only Git without a public Git server, he just uses Dropbox as a central git repository which acts as something similar to GitHub.
Think twice about the differences between using Git and using Github and the purpose of using Github and Dropbox together.
As to your question, Yes, you should keep your .git folder outside the Dropbox, as Leon suggested. Besides the reason he gives, which is the most important, there is another reason: the .git
folder can grow quite large and might occupy a significant amount of your Dropbox's total space.
Meanwhile, moving your Git repository completely outside of your Dropbox is strongly recommended.
Upvotes: 9
Reputation: 4483
Yes, it is important to keep your Git folder outside of Dropbox.
Dropbox can sometimes get confused and create a lot of duplicates of your files, such as filename~(conflict)
, which can really mess up your Git repository and require time to clean up.
Upvotes: 15