-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Merging a PR contribution
Seth Ladd edited this page Aug 10, 2015
·
5 revisions
This document explains how to cleanly land a pull request (PR) from
a contributor. Assumes the PR exists against the dart-lang/sdk
repo
and that the PR has received an LGTM.
Add these to the [alias]
section of your Git global config.
[alias]
pl = log --pretty=format:'%h %s' --graph
pr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; } ; f"
- Set up the
pr
alias from above - Start on the master branch. Make sure you've updated to latest.
git checkout master
git pull origin master
- Let’s say we’re dealing with Pull Request #42
- Run
git pr 42
- You’ll notice a new branch created
pr/42
- You’ll notice a new branch created
- Checkout
pr/42
git checkout p/42
- Rebase
pr/42
on top of master. This makes sure the history is replayed on latest.git rebase origin/master
- Now checkout
master
and rebase topr/42
git checkout master
git rebase pr/42
- This updates your local
master
branch to be the same aspr/42
- Push to origin.
git push
Important
The wiki has moved to https://github.com/dart-lang/sdk/tree/main/docs; please don't edit the pages here.