-1

I have created two branches from master branch. I have made some changes in the second branch. I am trying to pull the changes from second branch2 to first branch. I do not know how to merge the changes from second branch to first branch. So, How to do it?

c:\angular\project\(branch1)
git pull origin branch2
EMahan K
  • 417
  • 1
  • 19
  • 1
    `git pull` interacts with a remote repo. But in your setting you're only talking about a local merge operation. You might want to start by reading standard documentation on [the merge concept](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#_basic_branching). – Romain Valeri Mar 23 '23 at 11:28
  • @RomainValeri: Getting confusion. – EMahan K Mar 23 '23 at 12:05
  • @RomainValeri: Can you edit my code for proper comments? – EMahan K Mar 23 '23 at 12:06
  • To my opinion, this question lacks research, however, according to [this explanation](https://meta.stackoverflow.com/questions/301064/how-do-i-handle-triage-no-research-cases), I think this question looks OK. – HoRn Mar 29 '23 at 04:34

1 Answers1

1

You can git merge:
git switch branch1
git merge branch2
solve conflicts if any
git commit -am "conflicts solved"
git push

or

You can git rebase instead:
git switch branch1
git rebase branch2
solve conflicts if any
git commit -am "conflicts solved"
git rebase --continue
git push

Shlomi
  • 33
  • 7