Git version control management Part III: branching, merging

Source: Internet
Author: User

PART5 Branch

1.git Branch BUG/P1 -Create a new branch with the latest submission BUG/P1

2.git branch-a -View all branches, feature branches and remote branches, branches under current working directory marked as active branch with *,-represents merge Commit, + represents commit in one branch            

3.git show-branch bug/p1 -View specific branch content

4.git Checkout Dev -set the dev branch as the active branch (that is, toggle the current branch)          

5.git checkout-b bug/p2 -Switch to a new branch bug/p2       

6.git branch-d bug/p1 -Removes an inactive branch or deleted branch content that already exists in another branch

7.git merge Bug/p1 -the branch that will be removed to the current branch can be safely removed          

8.git reflog -Check Some branch switch and submit information              

PART6 diff View content Differences

1.diff-u seven.html eight.html -View the contents of 2 files What's the difference?

2.git diff -show index differs from local directory

3.git diff head -shows the head most recent commit differs from the local directory             

4.git diff--cached -show the head most recent commit and index differences           

Index: The state after submission. HEAD: According to stage staging area

Diff vs. log command: diff to see changes in content, log to see changes in branch or file commit history.

5.git diff master~2 Master file1 -View a file file1 different places in the commit process

6.git diff--stat Master~2 Master -How many files were changed during the statistics submission process

7.git diff-s "Quux" master~1 - search for content quux changes in master~1 submission point       

Part7 Merging

1.git Merge Alternate -merges the alternate branch onto the current branch

2.git Log--graph -Check Branch chart

--pretty=oneline -Show only one line

--abbrev-commit-Show only the simple code of the submission code

.

Git version control management Part III: branching, merging

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.