Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use git and dropbox together every day, but not like any of those people do. I keep my code dir with all my projects in my (personal) dropbox. So that's where my local 'working copy' repos live.

This way I can hack at work, hack at home, and hack on the plane... and I am never tempted to push one of those shitty "not done but committing because my flight to china is boarding" commits to the central repo (which is on a server accessed via ssh like normal).

It also saves my time because I don't have to git pull every time I switch computers in order to keep hacking where I left off.

That's a big, big win in my opinion, but it is just the same big win that Dropbox provides for various kinds of work. I don't see anything magical about the git+dropbox combo.



Why are you pushing shitty "not done but commiting because flight is boarding..." to the server? Surely they are only pushed to your local repo and then squashed in a commit to the main server. Or worked out on a feature branch then merged into the mainline?

You know you can git commit to you local repo without needing an internet connection.


Yes, I know git can do that, and I know pushing doodoo commits is bad practice; that was my point.

However, I prefer not to try to use a laptop for real work (because even the fastest laptops are much slower than a current Mac Pro). So, since I can't feasibly take my ginormous Mac Pro with me, as soon as I leave the office the repo on that workstation won't be my "local" one anymore.

Before moving my code into Dropbox, to avoid pushing something incomplete, I had to manually deal with transferring my local repo to the next computer(s) I was going to be working on it (typically that would mean copying the repo to a laptop for the plane, and then to a workstation at the destination).

That process was annoying and wasteful, and using Dropbox fixed that for me. Hooray!


i am still a svn user so i dont know exactly how git works, but how are you supposed to get your data on your other machines if you dont push it to the git server which is available from anywhere? Thats the point of syncing the working copy with dropbox, so you dont have to get it manually from your work machine. As i understand it git repos are local so my other machines wont have access to that repo, or am i wrong ?


In git committing and pushing are two different things. With git you have a copy of the repo, as does anyone else who checks it out. Think of each repo like its own little svn server, everyone has one locally. So you can commit to that and yes no one has access (unless you open it up to them, but no need to complicate this). So you can commit your unfinished work without other people seeing it, and still have history to be able to go back if necessary. Then when it's ready you can push that back to the shared repo.

Branching in git is really cheap and easy compared to svn. A good way to work to always branch before starting anything. Work on that branch, commiting whenever you feel like. You don't need to push that branch unless someone else wants to work on the unfinished feature with you, or needs something from it before it is ready. In the meantime if the mainline moves on ahead you can just keep merging it into your feature branch to get the new changes. When it's ready you can then merge it back into the mainline and push that.


I'm missing where you answered his question. He's talking about sharing his latest edit to his other machines, which aren't permanently network connected, without creating an explicit git version.


> You don't need to push that branch unless someone else wants to work on the unfinished feature with you, or needs something from it before it is ready.

If you want to share a commit that isn't ready, it really should go on a feature branch and not the mainline. Then you can squash it into a real commit when its ready.


Exactly. That approach is the biggest benefit imo. With working copies synced via dropbox you can just switch Machines and continue were you left off without having to push incomplete/not working code. You also get a cloud backup of all your local changes for free. Just dont work on a working copy that is out of Sync, but since you are only using this yourself, chances of corrupting something are much lower as with the approach described above.

For people with multiple machines this is awesomeness. Everybody else still benefits from the extra backup layer of dropbox.


It makes no sense to push to the server before they're done, why do you do this? Are you afraid your hard drive is going to go kaput while you're on the plane, or you're not taking your computer with you? That's the only reason I can think of to do this... git is not like svn, where commit and push are the same thing; on git, a push is the same as publishing for others to see, the commit is what's important and it doesn't require a net connection.


This is also what I do. The really annoying thing is that Dropbox doesn't sync permissions. It makes bit mess when a file is 777 in Git, but Dropbox resets it to 644 (I think).

This only happens when working on multiple machines.

Hopefully Dropbox will start syncing permissions soon.


Why don't you just pull the changes onto your laptop from your desktop, rather than pushing to the server then pulling back?


the thing with dropbox is that it does that automatically. No need to manually sync files all the time (which you tend to forget from time to time). Just leave work and continue working on the same stuff at home. Easy and convenient.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: