Working with Git on multiple machines

Posted by Tesserex on Programmers See other posts from Programmers or by Tesserex
Published on 2012-07-10T19:05:16Z Indexed on 2012/07/10 21:24 UTC
Read the original article Hit count: 183

Filed under:
|
|

This may sound a bit strange, but I'm wondering about a good way to work in Git from multiple machines networked together in some way. It looks to me like I have two options, and I can see benefits on both sides:

  • Use git itself for sharing, each machine has its own repo and you have to fetch between them.
    • You can work on either machine even if the other is offline. This by itself is pretty big I think.
  • Use one repo that is shared over the network between machines.
    • No need to do git pulls every time you switch machines, since your code is always up to date.
    • Never worry that you forgot to push code from your other non-hosting machine, which is now out of reach, since you were working off a fileshare on this machine.

My intuition says that everyone generally goes with the first option. But the downside I see is that you might not always be able to access code from your other machines, and I certainly don't want to push all my WIP branches to github at the end of every day. I also don't want to have to leave my computers on all the time so I can fetch from them directly. Lastly a minor point is that all the git commands to keep multiple branches up to date can get tedious.

Is there a third handle on this situation? Maybe some third party tools are available that help make this process easier? If you deal with this situation regularly, what do you suggest?

© Programmers or respective owner

Related posts about git

Related posts about Workflows