0

Let's say I have two computers, work and home. They both have clones of the same repo (shared on GitHub), and I have the same development environment on both computers.

Now, let's say I am working at home. I've created a feature branch, and I am working along, but I really don't want to commit/push right now... but I need to leave and go into the office.

Is there a way to keep these repos synchronized? Is there a command I can run to output the changes (including uncommitted) to something like Google Drive? That way, I can just get to the office, sync from my change file, and continue working as if I hadn't changed computers?

Aside from keeping my entire clone in a cloud share (like Google Drive, Drobox, etc), is there a git workflow I can use to avoid polluting my git history with half-working commits? Can I do something like stash to GitHub? Ideas?

Brian Genisio
  • 46,643
  • 16
  • 121
  • 163
  • I think you're looking for more of a cloud solution like Nitrous. I don't think Git has a good solution for keeping 2 workstations in sync. – Bauhaus Mar 28 '14 at 18:00
  • 1
    [Hey maybe I was wrong!](http://stackoverflow.com/questions/1550378/is-it-possible-to-push-a-git-stash-to-a-remote-repository) – Bauhaus Mar 28 '14 at 18:06

1 Answers1

0

Create a bare repository using

git bare --init

Then push your feature branch there.

Go home make a clone of your bare repo and you are done.

You could just take the bare repository in a usb drive and have it.

Or you can have it in a Dropbox for example and access it.

I am doing this in my office by having a central repository in a server. Then when i finish my job i go home, connect with vpn and make a direct git clone of what i need and work.

I am using also WebGit.Net an open source ASP MVC frontend for my bare repositories.

LINK

e4rthdog
  • 4,841
  • 4
  • 31
  • 79