Skip to content

Commit 3507b14

Browse files
authored
Merge pull request #4621 from rlaverde/git-commands-contributing
PR: Add git command for changing base branch to Contributing guide
2 parents 7752ec8 + 717205e commit 3507b14

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: CONTRIBUTING.md

+15
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,21 @@ So to start working on a new PR, you need to follow these commands:
101101
$ git checkout -b name-new-branch
102102
```
103103

104+
### Changing base branch
105+
106+
If you started your work in the wrong branch, or want to backport it, you could
107+
change the base branch using `git rebase --onto`, like this:
108+
109+
```bash
110+
$ git rebase --onto <new_base> <old_base> <branch>
111+
```
112+
113+
For example, backporting `my_branch` from `master` to `3.x`:
114+
115+
```bash
116+
$ git rebase --onto 3.x master my_branch
117+
```
118+
104119
## Running Tests
105120

106121
Install our test dependencies:

0 commit comments

Comments
 (0)