whatyouhide
whatyouhide

Reputation: 16781

Git + GitHub + Dropbox

I'm new to git and GitHub. This far, I managed to setup my environment so that I can push commits to GutHub via the git program.

I own two computers, which share files using Dropbox. That's where I keep my development projects too. What I wanted to know is: is there a way to use git, GitHub and Dropbox altogether? I read guides to use git and Dropbox without stepping through GitHub.

In a practical example: say I am in a project folder on my laptop (the project folder is on Dropbox). I git push origin master and everything goes fine, updated on GitHub. Now on my desktop I have the updated files, synched via Dropbox.

Should I git pull the most recent version from GitHub anyway?

Edit

Lots of people think I'm asking how to use git along with Dropbox. I'm not.

What I'm asking is how to keep your work inside Dropbox, use git anyway and still be able to push to GitHub sometimes.

Upvotes: 3

Views: 562

Answers (1)

Glitch Desire
Glitch Desire

Reputation: 15023

OK, I'll split this up into its constituent questions:

1. Should I use git pull anyway?

If these two computers are the only ones you use to modify this code base, and nobody else is pushing to the remote repository, there'd be no reason (other than good practice) to run git pull in this instance. Your Dropbox is doing the job of keeping your code synchronized and your Github will be serving your code to the world at large.

2. How to git push anyway?

Dropbox won't affect this, your .git folder and .gitignore file are the components which define what will be pushed. Dropbox will be invisible to the whole process UNLESS you try to git push half way through a Dropbox synchronize job in which case you could end up with some consistency issues.

3. Are there any advantages?

I don't think Dropbox really gives you very much here as you're using Github. Having said that, I use a similar setup with a NAS drive connected to my home computers, I just use my svn (I've been meaning to move to bzr but keep failing to do it) to update when I'm on the road.

Upvotes: 3

Related Questions