简体   繁体   中英

How to move commit to master from another branch

I have master branch and a developer branch. I did some work on developer branch, and now i want to commit my final work (final project) to master branch. How to do that?

Standard:

git checkout master
git merge develop

# if there are merge conflicts, resolve them and follow with:
# git commit

That will transfer all of the historical commits on develop to master . If you want to keep master 's commit history clean, you can squash it all into one commit:

git checkout master
git merge develop --squash
# resolve any merge conflicts
git commit

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