Logo

dev-resources.site

for different kinds of informations.

How to do git handover while doing remote mob programming?

Published at
11/14/2024
Categories
softwareteaming
remote
mobprogramming
git
Author
dskeppstedt
Author
11 person written this
dskeppstedt
open
How to do git handover while doing remote mob programming?

The ritual of handover via git in mob programming (or pair or other software teaming techniques) is crucial for keeping the focus and pace.

If you often end up in messy situations caused by git, this is the guide for you!

In a remote mob programming session the most common way of doing the handover is via git using a temporary branch in origin as synchronization point. There is even a good tool built for this called mob.sh.

However, in this post, we will focus on how to do it ourselves.

Git โ€“ Keep it simple

I cannot stress this enough. Keep it simple should be the leading idea when doing handovers. As soon as you try to get fancy with git, you increase the risk of messing up and that the team loses focus.

1. Create a branch named wip

The name is really not that important, you can call it mob or asdf.โ€จ
โ€จ
The important thing it should be easy to say and type, and it should be short. โ€จ
โ€จ
This makes it easier for everyone in a remote call to hear the name of the branch and be able to check it out.

To create a branch:

git switch -c wip
Enter fullscreen mode Exit fullscreen mode

2. Push the branch

The first driver of the session creates the branch and pushes it.

To push the branch write:.

git push origin wip
Enter fullscreen mode Exit fullscreen mode

3. Everyone else switch to the wip branch

Now itโ€™s a good time for everyone else in the rotation to fetch the wip branch to make it easier during handovers.

Simple write the following command:

git switch -c wip origin/wip
Enter fullscreen mode Exit fullscreen mode

4. Code

Start the timer and start implementing the code!

There are a lot of different timer apps out there, Iโ€™m building a timer app called Remobster, if you are interested in checking it out, sign up for the waitlist to become an early access user ๐Ÿ™‚

Other alternatives are:

5. Time for the git handover

When the time is up for the current driver, itโ€™s time to handover to next driver.

First add all changes in the repo:

git add .
Enter fullscreen mode Exit fullscreen mode

Then commit the changes:

git commit -m wip
Enter fullscreen mode Exit fullscreen mode

The reason we set the message to wip, is to make the handover to the next driver as fast and smooth as possible.

The driver then pushes the changes:

git push origin wip
Enter fullscreen mode Exit fullscreen mode

Next driver

Now the next driver can safely continue. The only thing the new driver needs do to is:

git pull origin wip
Enter fullscreen mode Exit fullscreen mode

and then follow steps 4 and 5. And then you just repeat!

Finish up

When the mob session is happy with the code and wants to deliver it, I recommend squashing all the commits into sane pieces and write good commits messages describing the changes.

This step should also be done together in as many rotations that is needed to create a git artifact that fulfills your requirements.

In my team we usually do something like this:

git rebase -i origin/main
Enter fullscreen mode Exit fullscreen mode

This opens an interactive editor (usually vim) where you can decide what to do with each commit:

pick abc1234 wip 
pick def5678 wip
pick ghi9012 wip
Enter fullscreen mode Exit fullscreen mode

On the first commit change pick to r and for the other commits change them into f like this:

r abc1234 wip 
f def5678 wip
f ghi9012 wip
Enter fullscreen mode Exit fullscreen mode

This will let you rewrite the first commitโ€™s message into something better and the other commits will be squash into the first commit, removing their messages.

Read this article to learn how to write great commit messages

When you are happy with your new commit messages, force push the wip branch by:

git push โ€”force origin wip
Enter fullscreen mode Exit fullscreen mode

Then you are done, now you can merge the wip branch into main or open a PR/MR if that is needed in your process ๐ŸŽ‰

Original post

remote Article's
30 articles in total
Favicon
Inter-process Communication with WitCom
Favicon
WitCom: Modernizing Client-Server Communication
Favicon
How to Make the Most of Remote Work Opportunities
Favicon
React Expert(long-term/remote/full-time)
Favicon
Shared remote development environment in our research group
Favicon
Track-POD: Revolutionizing Delivery Management for Modern Businesses
Favicon
We are Hiring Data Entry Specialist
Favicon
โœจ Work From Home Opportunity: Data Entry Specialist Wanted! โœจ ๐Ÿ’ป Position: Remote Data Entry Specialist ๐Ÿ“ Location: Work From Anywhere! ๐Ÿ‘‰ Click Here to Apply - https://tinyurl.com/5caun7ar
Favicon
โœจ Work From Home Opportunity: Data Entry Specialist Wanted! โœจ ๐Ÿ’ป Position: Remote Data Entry Specialist ๐Ÿ“ Location: Work From Anywhere! ๐Ÿ‘‰ https://za.gl/KFOZbTY4
Favicon
Remote vs. On-Site Work: How to Tailor Your Resume for Both
Favicon
Evolving Beyond Scrum for Modern Workflows
Favicon
Global Talent: The Employer-Independent UK Visa
Favicon
Complete Guide to AI Training Jobs: Latest Opportunities in 2024
Favicon
How to do git handover while doing remote mob programming?
Favicon
Top 5 Time-Tracking Tools for Remote Teams
Favicon
Why Japan's IT Industry Risks Being Left Behind - A Path to Individual Success
Favicon
Effective Remote Development Team Management: Best Practices for 2024
Favicon
The Role of Video Conferencing in Remote Education
Favicon
5 liรงรตes que aprendi depois de trabalhar remoto por 7 anos
Favicon
๐Ÿ—บ Trabajo remoto
Favicon
๐Ÿ—บ Remote Work
Favicon
LatHire
Favicon
How Remote Registry Services Can Improve Patient Registration and Follow-up
Favicon
Understanding SSH Key Pairs: A Developer's Guide
Favicon
SSH Config File - Forgotten Gem
Favicon
10+ Tools to Help Remote Developer Teams Work
Favicon
Is Remote Work Here to Stay?
Favicon
AI Serendipity - Uncovering the Unexpected
Favicon
Leveraging Social Swirl's Power for Education
Favicon
Access Your Computer Anywhere with VS Code: A Guide to Remote Tunneling

Featured ones: