Remote Pair Programming -- my tips and best way to use git?

I just did a pairing session using ScreenHero and RubyMine. I really enjoyed it and I put together a detailed article on it: Remote Pair Programming Tips Using RubyMine and Screenhero. This may be my most ever retweeted article.

What’s the best way to use git branches to easily share temporary commits?

When working by myself, I’ll often do a

git commit -m "WIP"

And then switch branches, do something else, and then switch back to the branch and then do a:

git reset --soft HEAD\^

This could work using 2 pairing developers and using a feature branch, except that when one goes to push, one will overwrite the last WIP commit:

git push origin +my-feature-branch

(Note the use of the syntax of putting a + in front of the feature branch to do a force push, rather than using the --force or --force-with-lease, from the docs: “By having the optional leading +, you can tell Git to update the ref even if it is not allowed by default (e.g., it is not a fast-forward.)”

Another option would be for each developer to have a WIP branch and to then merge each other’s changes as work progresses.

Does anybody have any feeling what might work better?

p.s. If you have any feedback on my blog article, please post here or in the blog article contents. Much appreciated!

Free yourself. Use tmate and vim :smile:

You are passing so much bandwidth you don’t need to be passing over a network to render their desktop crap.

I personally have a policy of NOT pushing wip or ever making a commit wip. That does not state what you did and it can lead to broken builds. Don’t push up what isn’t working.

Also, rather than forcing a push (which you should not need to do unless your rebased your commits) you should just push and add a -f IF you changed the tree.

When working with multiple team mates…

get checkout master
git fetch origin
git reset --hard origin/master
git checkout -b rubylove/feature-branch
... do work
git add --all -p
... stage your chosen patches
git commit -m'a good commit message of what you just did'
git push origin rubylove/feature-branch

Then when you are ready to merge your pull request:

get checkout master
git fetch origin
git reset --hard origin/master
git checkout my-working-branch
git rebase master
git push origin

If you would like to pair on this kind of thing today, hit me up Justin. Tweet at me in case I miss it here. @thatrubylove

You might also want to check out hitch, which lets pairs track their git commits as the pair in a fairly easy-to-use fashion.

1 Like yeah that is awesome indeed!

@Justin_Gordon, you got a mention in Ruby News this week!

Sweet! BTW telepresence using iPad Mini is AMAZING! See the video I posted here. Even standup scrum meetings!

When sharing a 1080p screen, from Maui to SF is perfectly crisp. Sharing a thunderbolt screen is almost perfectly crisp!