Reputation: 45921
I'm learning how to use Source Tree with bitbucket and now I don't know how to do this:
We have installed a release in our client, and we want to copy all the changes into master branch and tag it.
If I checkout master branch and do a merge with develop branch I will lose develop branch.
How can I move all the commits to master branch without loosing develop branch?
Upvotes: 2
Views: 2933
Reputation: 1220
Merging a branch does not delete the branch being merged, at least not by default.
Also, for your information, you can always checkout a specific commit (in your instance the latest commit in the develop branch) by doubleclicking it in Source Tree - You will be warned that this would create a "detached" state, and them simply click the "branch" button to create a new branch from there.
Upvotes: 0
Reputation: 106430
If I checkout master branch and do a merge with develop branch I will lose develop branch.
That's not true; the branch will still exist. The tip of your develop branch will be at the same point as master, which is to be expected at that point, though.
Feel confident to merge the two branches together. You won't lose anything (unless there's a merge conflict that isn't resolved correctly, but here's hoping that there are tests in place to prevent that).
At that point, it's a matter of creating the tag via git tag -a <tagname>
, then pushing it via git push origin <tagname>
.
Upvotes: 2