Reputation: 1132
I have a personal project using git that I often hack on across multiple computers, hosted on Github. Since I work on this at home I tend to get interrupted fairly often. I'll be in the middle of a statement, and dinner will be ready or I need to change a diaper. And when I get back to coding I may be on a different computer. What's the best way to get the most up-to-date version?
I think the most orthodox answer would be to commit and push. I commit fairly often but committing here seems messy to me. The code may be in a completely broken state where I was in the middle of a thought. To commit and publish it, even on a topic branch, doesn't seem right to me. It's also more steps than I would prefer.
Until now I've been using DropBox. But this appears to have lead me to a corrupt index. It's not hard to imagine because those syncs can be across different versions of git and different operating systems. So I'm afraid this it out.
Does anyone have a better alternative?
Upvotes: 6
Views: 1756
Reputation: 3748
I'd suggest writing a small script to rsync the required directories to all of the specified machines. Should be very simple and can be aliased so it's just a one liner from the terminal.
Where I work I do this often, dev on local machine using vhost to test but when I need to test on a mobile device, I can rsync everything to the public dev server and use the vhost there from the mobile device.
Upvotes: 1
Reputation: 150785
An alternative to using Git to keep a codebase in sync across computers is to keep the actual codebase on your dropbox. Essentially, it just a local folder that's synchronised, so that whatever computer you're on (as long as you have saved your current work) it will be synced for you. It saves the step of pushing and pulling to a git repo on dropbox.
Upvotes: 2
Reputation: 13773
One solution would be to use a private server. Either pay for a GitHub micro account, or just use some server to which you already have access. Then you'd commit, and push to the private server. When the code is ready you'd push to the public server after squashing / cleaning up commits, etc.
Upvotes: 0