I am new to git. I have a branch named BranchA from the master. I have some changes in BranchA (I am not going to merge changes from BranchA to master) Now I have created another branch from the master named BranchB. I want the changes from BranchA to BranchB.
Can anyone help me how to achieve this?
Thanks
This question is related to
git
Instead of merge, as others suggested, you can rebase one branch onto another:
git checkout BranchB
git rebase BranchA
This takes BranchB
and rebases it onto BranchA
, which effectively looks like BranchB
was branched from BranchA
, not master
.
This is 2 step process
If you want to push your branch code to remote repo then do
Merge the changes from BranchA to BranchB. When you are on BranchB execute git merge BranchA
If you are using tortoise git.
please follow the below steps.
Now your changes moved from BranchA to BranchB
Copy content of BranchA into BranchB
git checkout BranchA
git pull origin BranchB
git push -u origin BranchA
Source: Stackoverflow.com