I'm new to the world of git, and also to Atlassian
and SourceTree
, so I've very basic about this.
What I want achieve is that:
Suppose that I've a branch called master
, which I develop my application with all new features and bugfix, and another branch called release
, what I want to do is merge all the content of the master
branch, to ther release
branch.
What I did so far:
Selected the master
branch on the branches
view on the left of SourceTree
Clicked on the join
button on the header of SourceTree
and then on Ok
.
Clicked on the Send
button on the header of SourceTree
.
After the step 3, nothing happen, in my BitBucket
repository I doesn't see any Release
branch, I've actually created this branch on SourceTree
only. Someone could tell me what am I doing wrong?
Thanks.
After running the stash command for a branch, if the git user wants to pull the branch's changes to another branch, it can be done easily by using the `git stash pop` command that works like the `git merge` command.
First we run git checkout master to change the active branch back to the master branch. Then we run the command git merge new-branch to merge the new feature into the master branch. Note: git merge merges the specified branch into the currently active branch.
To me, it sounds like you're not pushing the correct (or all) branches to BitBucket. Here is a complete example of how it's done:
Let's assume you have a repository with two branches: master and release. You do development on the master branch and only do releases on the release branch. It will then look something like this:
When you want to merge the master branch into the release branch you checkout the release branch (right click on it and choose Checkout release...). Then right-click on the branch you want to merge into the release branch (master) and choose Merge master into current branch. The result is this:
You now have to push the changes to BitBucket. Click on the Push button in the toolbar. The following dialog will pop up:
You now have to choose the branches you want to push. If you don't push a branch it will not end up on BitBucket. In this case, I want both my branches to be there so I'll tick both the Push? checkboxes. On BitBucket it will now look like this on the Branches page:
You will also see the remote branches in SourceTree under the remotes dropdown.
What you're most likely doing wrong is that you're not pushing the release branch to BitBucket.
Follow this step-by-step process:
MERGE ONE BRANCH INTO ANOTHER
Branch B is new branch and we want want branch A code in B
Ok
>> <<
You have A changes in B
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With