0

I have a BranchA. I did the modifications on BranchA, and wrote a decent comment on it. Then I realized I should do it on a new branch. So I built a new BranchB based on BranchA.

git checkout -b BranchB BranchA

BranchB has all the changes made in BranchA. But BranchB can be pushed, because BranchB has "nothing" be changed from BranchA.

How do I push BranchB to origin BranchB?

Administrator
  • 254
  • 1
  • 8
  • 2
    Possible duplicate of [How to commit my current changes to a different branch in git](https://stackoverflow.com/questions/2944469/how-to-commit-my-current-changes-to-a-different-branch-in-git) – Mebin Joe Apr 03 '19 at 05:17

2 Answers2

0
git rebase origin/master

That all your changes to the origin/master would be presented.

Zhang
  • 3,030
  • 2
  • 14
  • 31
0

Please use this software to manage your branch easily: https://www.sourcetreeapp.com/

First Commit your code and push it on BranchB

git commit -m "Your Message"
git push BranchB

Then Marge branch BranchB into BranchA

git merge BranchB BranchA

Merging 2 branches together in GIT

Parth Patel
  • 915
  • 11
  • 33