0

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?

msanford
  • 11,125
  • 10
  • 64
  • 87
Eduard Florinescu
  • 15,293
  • 28
  • 107
  • 170
  • 3
    Possible 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 Answers1

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
  • 69,888
  • 11
  • 97
  • 133
  • 2
    We 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