Git-Git Book Reading Notes

Source: Internet
Author: User

Git diff [fname]
Git diff -- staged [fname]

The. gitignore file does not want to be included in git management or appear in the list of untracked files.
DIR/ignore all files in the directory
DIR/*. txt ignores all TXT files in the directory, but does not ignore subdirectories
DIR/**/*. txt ignores all TXT files in the directory and also contains subdirectories.

Git Rm -- cached readme.txt * removes the trace but does not delete the file. It is convenient to put it in. gitignore.
Git RM log/\ *. Log Delete log files in the log folder
Git RM \ *. txt recursively deletes the TXT files in the current directory

Git MV fname nfname mobile operation, which is equivalent to the following three commands
MV fname nfname
Git RM fname
Git add nfname

Git log-P-2 # P represents the difference in content submitted each time (patch) 2 represents displaying the last two updates

Git commit -- Amend modifies the description of the last commit and resubmit only generates a commit once. The comments of the second commit overwrites the first commit.

Git reset head fname is restored from the temporary storage area to the Workspace

Git checkout -- fname is restored from the version Library to the work zone

Git-Git Book Reading Notes

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.