The good git process to work alternatively at home and at office

I have a very similar setup and never have merge conflicts: I essentially do what you do, but I never use rebase in any fashion, until possibly at the very end, as part of merging to master.

Concretely:

  • I commit and push frequently while I'm working, using the origin as a backup tool.
  • I can switch easily to another computer by just doing a default fast-forward pull/fetch on it, and then getting to work there.
  • Finally, when the code has been reviewed in the PR, I perform some kind of merge or rebase or squash/merge depending on the project's style.

I know that this is not the preferred "expert" way to work, but it has two awesome benefits:

  1. I switch between multiple development computers (desktop here, laptop or two there...) without any thought at all. Just a git pull and I'm off...
  2. I never have conflicts.

Tags:

Git