简体   繁体   中英

Merge develop branch into master branch without closing develop

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?

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> .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM