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,803
  • 11
  • 66
  • 93
Eduard Florinescu
  • 16,747
  • 28
  • 113
  • 179
  • 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
  • 82,685
  • 13
  • 120
  • 165
  • 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