0

My project has some 15+ branches and in the master branch, I have updated my library versions and some project configurations. I wanted to update this config file in all my other branches. For that do I need to switch each branch one by one and merge it with the master? Or is there any shortcut to update this particular file in all the branches with the master branch version? Is there any option to do so in Android studio?

  • Honestly if you have 15 _concurrent_ branches then I could argue that your development efforts might be stretched a bit thin. The reason I have never seen this request before is that most software shops usually are only focused on a handful of branches. I think you might just have to do a merge or rebase of each of the 15 branches, though you may want to examine why you have so many active branches in the first place. – Tim Biegeleisen Oct 27 '17 at 05:07
  • Honestly if you have 15 _concurrent_ branches then I could argue that your development efforts might be stretched a bit thin. The reason I have never seen this request before is that most software shops usually are only focused on a handful of branches. I think you might just have to do a merge or rebase of each of the 15 branches, though you may want to examine why you have so many active branches in the first place. – Tim Biegeleisen Oct 27 '17 at 05:07
  • You can just make change in master branch and just pull it from all 15 branches. – prabin badyakar Oct 27 '17 at 05:10
  • @TimBiegeleisen actually its not a live project, its just a sample project where I keep all the samples in different branches :). so libraries such as retorfit, rxjava are used in all the branches and whenever I need a library update I have to switch to each branch manually and pull the changes from master –  Oct 27 '17 at 05:12
  • Its not possible to update in all branches at once. You can view further details over the similar post https://stackoverflow.com/questions/21459976/git-commit-to-all-branches – Vijay R. Oct 27 '17 at 05:29

1 Answers1

1

Checkout to commit where you 'updated library versions and some project configurations' Create local temp branch on that commit Checkout one of your 15 other branch (do it for all) Merge temp branch (which contains changes you need) to your branch

git checkout commit_hash_with_updated_library_changes
git checkout -b temp_branch
git checkout one_of_your_15_branches
git merge temp

If your temp branch has more changes that you do not want on other branch. Just reject that changes during merge.

oginski
  • 354
  • 5
  • 16