Why Every Agile Development Team Needs a Hacker

Agile is a popular project management method that prioritizes flexibility and collaboration in software development. One aspect of agile that is often overlooked is the importance of having a hacker…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Stacked Pull Requests on Github

The first step is to install git-town with is a workflow layer on top of vanilla git. It makes creating stacked pull requests incredibly simple and has some additional functionality for keeping your stack of PRs in sync.

This will pull in latest changes from origin/main and create a new branch off of it.

Next, make some changes to your code, and commit them:

Then, use git town to create a new pull request:

This will sync your local branch to github and open the new PR creation in your browser.

The workflow is the exact same as above, except you use git town append :

….same as #3

Once you have done this, you’ll have a stack of pull requests:

If you look at the first PR the upstream branch is main :

But the subsequent PRs are now stacked on top of this one:

Once your code is reviewed, you can start merging. Once you have merged a parent branch and deleted it, github will automatically rebase the PR on top of main.

Branches are automatically rebased to main upon it’s parent base branch being deleted.

That’s it!

This is where the git-town workflow tool really shines.

Continuing with our example above, say you have changes to make to the first:

To make sure every single branch in your stack receives these changes, just checkout the last branch in your pull request, and run git town sync

That’s it! 💯

Add a comment

Related posts:

Short Overview of ChatGPT

The record of accomplishment of chat programs that are powered by artificial intelligence (AI) has not been awe-inspiring up until this point. In November 2013, the Facebook group Meta hosted a game…

7 Ways to Improve the Weather Inside Your Head

You can hope for a mostly sunny disposition, but sometimes there are just days when you are faced with big, black, mental thunderclouds that you have no choice but to wait out. Luckily, as with the…

How social proof and partnerships can improve road safety

Automobile associations (AAs) represent millions of motorists worldwide. Our Co-Founder Matt Peterman explains how members can benefit from VouchForMe and lower their insurance premiums while…