I have created a local git repository in C:\temp\ConsoleApplication1
. Then I click the Git Flow
button and follow by OK to accept all default settings. Now under the branches, I can see develop and master.
Next I click Git Flow again to start a new feature, then make some changes and finally finish the feature.
Now my branch looks as follows:
[develop] add line 1 [master] initial commit
Question: I would like to merge the develop into the master branch. What is the right method to achieve that?
I have tried to select develop
branch, then click Merge
button. No matter which commit I choose, there is nothing happens. I also tried to select master and see no difference.
Once the feature is complete, the branch can be merged back into the main code branch. 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.
Basic main/master branch development logic is: You work only on another branches, so you use main/master branch only to merge with another branch which is ready for merging.
master
Not entirely clear in the question, but did you try this already? The key step is making sure you currently have master
checked out.
Sourcetree has changed a fair bit since this question was asked, but just in case others arrive here and don't quite understand the new "Merge" button, all you need to do is checkout the branch you want to merge your changes into, e.g. "master" (double click on the branch on the left in Sourcetree under "Branches).
Next, just right-click on the branch you want to merge into your current branch (e.g. "my-new-branch") and from the right-click menu, select "Merge my-new-branch into master". This helped me coming to Sourcetree as a GitKraken user.
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