git between two local machines setup [self reminder];

Had to figure this out again today, so thought I’d write it down so that I could find it next time, and maybe someone else would find it useful.


  • git master rep on
  • local repo on desktop
  • local repo on laptop

Made changes and several commits on my laptop, didn’t want to push them to origin (github) because not ready to impact rest of team  yet, but wanted to work on my desktop (bigger screen, faster, more ram).  So, needed to get my changes from laptop local repo to desktop local repo, but not via origin on github.

add new remote in git on desktop for laptop (I did this in Tower this time, but obviously can be done from command line via something like:  git remote add laptop ssh://laptopname.local/Users/me/full/path/to/laptop/local/repo/).


  • Remote Login enabled in Sharing section of System Preferences
  • desktop ssh public key be in authorized_keys on laptop
  • both on local network (for .local host name use, can use ip address if not).

the remote address then is something like:


and then it works.  Obviously you’ll likely want the same thing in reverse so you can move code from desktop to the laptop.

Probably old-hat for git pros, but that I’m not (yet) :).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: