Git Versioning Management Learning Note 5-submit

Source: Internet
Author: User
Tags git commands

This headline is actually a bit confusing, because it would be a verb or a name for this submission?

The commit action is implemented by the Git commit command, and a new commit object is added to the object library after committing. What will happen in the submission process, which has been introduced in the previous note, and can be seen in the process map.

It should be clear that in Git, the repository changes and commits are one by one corresponding relationships, that is, commit is the only way to introduce changes to the repository.

When Git commits, it records the snapshot of the index and stores the snapshot in the object library. Before the next commit, the state in the current index is compared to the last generated snapshot, and a list of affected files and directories is derived.

One, the atomic change set:

Each commit represents a single set of atomic changes relative to the previous state, either successfully or completely rejected at the time of submission.

Ii. Identification and submission:

This section focuses on the presentation of commits in git, including explicit and implicit references. For example, a 40-bit SHA1 code is an explicit reference, and head is an implicit reference.

Here you will find different ways to write various references.

    • Absolute commit name: is actually a hash identifier. You can use the following command to view.
[[email protected] committest]# git log-1 --pretty=-1 --pretty=oneline 2a9b2a9b52785b94c45852276c4febb4e05d9e25de1f New Data Ty
    • References and symbolic references: Local feature branch names, remote trace branch names, and tag names are references. There are 3 different namespaces in the directory that represent different references: the REFS/HEADS/REF code local branch, the REFS/REMOTES/REF represents the remote trace branch, and the Refs/tags/ref represents the label.
find . git/refs/git/refs/. Git/refs/tags.git/refs/heads.git/refs/ Heads/master
. git/refs/remotes/ref
. git/refs/remotes/ref/head
    • Relative commit name: Look at the following example to find out.

C^1: Equivalent to c^, which represents the first parent commit to commit C.

C^2: Represents the second parent commit to commit C.

C~1: Equivalent to c~, which represents the first parent commit to commit C.

C~2: Represents the submission of the first grandfather of C.

C~3: Represents the submission of the first great-grandfather of C.

c~3^2^2^: Represents the first great-grandfather commit of C----the second parent commits----the second parent commits.

Here are the GIT commands to use:

[[email protected] my_website]# git rev-parse Mastere4db73549d3e9289b8ec9c5ec325e1a672942f28[[email protected] my_website]# git show-branch-- More= *|Tail-Ten[Master] rename2[master^] Rename[master~2] Test[master~3] Remove[master~4] Test[master~5] Remove a poem[master~6] This is poem, the secondfileadded![Master~7] FIRSR change[master~8] Initial contents of public_html[[email protected] my_website]# git rev-parse master~63df360e031a40a3c7e35856ed4f0b8f63551c89b

Third, the submission of the historical record:

1. View Old submissions:

Here are just a few example commands.

[[email protected] my_website]# git log master

[[email protected] my_website]# git log--pretty=short--abbrev-commit master~6 master~3

[[email protected] my_website]# git log--pretty=short--stat master~6 master~4

2. Submission Diagram:

Iv. Find Submissions:

Use the following tools to not focus on:

    • Git bisect
    • Git blame
    • Pickaxe

Git Versioning Management Learning Note 5-submit

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.