Use git 3 branch (study Note 3)

Source: Internet
Author: User
Tags git mergetool
Use git 3 branch (study Note 3) branch gitbranchnew // create a new branch to directly merge (merge) gitcheckout-balternatemaster // directly create the alternate branch and go to the branch; create a new gtiaddabo in the alternate branch... use git 3 branch (study Note 3) branch git branch new // create a new branch to merge directly (merge) git checkout-B alternate master // directly create the alternate branch and go to the branch. create a new gti add about.html on the alternate branch and submit it in git commit-m "add about.; Checkout to master branch git merge alternate // to back to master branch, and then merge alternate branch merge (squash) git checkout-B contact master // create a new branch; git add contact.html and git commit-m "add contact.html "; git checkout master back to master branch git merge -- squash contact // compress all the commit entries on the branch into one commit entry and submit it to the end of the other branch; you can use git status and git log to view the status in the temporary storage zone.; You can use git commit to submit the pick and merge (cherry-picks) git checkout contact // to the contact branch; git commit-m "add witter "; git chechout master git log git checkout master // return to the master node git cherry-pick 321d76f // pick up the commit entry git reset -- hard HEAD ^ git cherry-pick-n 321d76f // example you need to select multiple commits and use git cherry-pick-n. then you can use git status to view the status git commit-m "cherry-pick commit. "// commit conflicts again. for simple conflicts, you can manually modify them. for complex conflicts, you must use the visualization tool git mergetool // git merge tool me. Rge. tool value // kdiff3, tkdiff meld xxdiff emerge, vimdiff, gvimdiff ecmerge, opendiff, and other tools. Git branch-d about // delete the about branch. if the branch is not merged, a prompt is displayed: git branch-D about // delete the about branch, git branch-m master mymaster will be deleted no matter whether it is merged or not. // rename the master branch to mymaster git branch-M mymaster master // rename mymaster to master no matter whether matser is saved or not, it will overwrite
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.