I am working on some abandoned repo that has two dozen feature branches, and I want them in master, is there a way to rebase then all in one command or do I have to do them one by one?
Asked
Active
Viewed 71 times
0
-
3Possible duplicate of [How can I rebase multiple branches at once?](https://stackoverflow.com/questions/23386318/how-can-i-rebase-multiple-branches-at-once) – msanford May 15 '19 at 13:40
1 Answers
2
You can do merge in one command:
# providing the current branch is `master`
git merge br1 br2 br3
As for rebase, it very much depends on what you mean by "one command". Is the following one command?
for br in br1 br2 br3; do git rebase master $br; done

phd
- 82,685
- 13
- 120
- 165
-
2We can probably argue to decide if it is "one command" or "one liner" but that would be off-topic as "opinion based" :D – Zeitounator May 15 '19 at 14:07