-1

I have three branches and I am working on one of them. I am changing the file, and I need to update this file in two other branches. Can I do this with Git or do I need to go to another branch and just copy and paste?

Thanks

Nikita Goncharuk
  • 795
  • 1
  • 8
  • 23
  • 4
    I don't think the user deserves a downvote. This is not really how git works, but instead of downvoting, explain to him why this isn't a feasible question – Alicia Sykes May 04 '19 at 12:21
  • Is the file in the same state in all three branches? Can you clarify why you need to do this please – AD7six May 04 '19 at 12:54

1 Answers1

2

commit and push your changes in a single branch, and then create pull request for the other two branches on git (gitHub, gitLab.. etc) and merge it.

or use git merge for more info check git-merge

or use git rebase for more info check git-rebase

For futher details check the difference between the two merging-vs-rebasing

Murtaza Hussain
  • 3,851
  • 24
  • 30
  • 2
    cherry picking the commit to the other branches would likely be more appropriate - there’s no indication in the question the branches share history, or that it’s desirable to pull _all_ changes from one branch into the others. – AD7six May 04 '19 at 12:53