-2

I have forked someone else's branch in GitHub and he had more than 100 branches. Is there is any way to merge all branches at once to master so that I can view all files at once to master.

Any help will be appreciated!

GoodDeeds
  • 5,837
  • 4
  • 28
  • 51
  • 10
    Merging has much deeper consequences than viewing. Merging all branches at once is unlikely to make sense. What is your real goal here? – matt May 07 '20 at 12:47

1 Answers1

0

As others have mentioned, this probably isn't a thing you want to do. Work on a branch may be very different from the main branch and it may be out of date or otherwise not something you actually want. I have tons of branches on some projects and tons of them are out of date or just abandoned.

If you're certain you want to do this, you can create a temporary branch and then merge all the branches together that you're interested in with an octopus merge. Note that octopus merges must be clean; that is, they just fail if they would conflict. You can do this like so:

git checkout -b temp
git merge branch1 branch2 branch3 # and so on

If there's a conflict, then you'll have to invoke git merge with one branch at a time.

bk2204
  • 31,903
  • 3
  • 22
  • 39