Git command learning Notes

Source: Internet
Author: User
Git command learning notes: Git initializes the gitconfig command. The Git configuration file adopts the INI file format, gitconfig is used to read and change the content of the INI configuration file gitconfig [] namevaluegitconfig [] -- unsetname initialization name... git command learning notes Git initialize git config command. The Git configuration file adopts the INI file format, git config is used to read and change the content of the INI configuration file git config [] name value git config [] -- unset name initialization name and email address git config -- system user. name "li song" git config -- system user. email sundayls@qq.com alias settings: git config -- system alias. delete ci commit: git Config -- unset -- system alias. ci command output enable color display git config -- global color. ui true -- global and -- system indicate the configuration location. -- Global indicates the configuration in the user's home directory, and -- system indicates the system level configuration file. If this parameter is not added, it indicates the version Library level configuration file. The operation file. git/index in the temporary storage area is actually a directory tree containing the file index, which is a virtual workspace. The directory tree of this virtual workspace records the file name and file status information. The file content is stored in the Git object library. git/objects directory. Git add indicates to write the content of the specified file to a new object in the object library, update the directory tree, and record it to the file index in the temporary storage area. Git commit indicates to write the directory tree of the temporary storage area to the version library, and the master node is updated to point to the new directory tree (that is, the directory tree of the original storage area ). Git reset HEAD: replace the number of directories in the temporary storage area with the directory tree pointed to by the master. the work area is not affected. Git checkout description: git checkout [] [--]... indicates replacing the temporary storage zone and workspace with the directory tree pointed to by commit. If commit is omitted, it is equivalent to checking out the temporary storage zone. example: git checkout -- Replace git checkout in the workspace with the file in the staging area. replace git checkout HEAD in the workspace with all files in the staging area. Replace the temporary storage area and workspace file git checkout with the directory tree file pointed to by the master [ ] Example: git checkout branch updates the HEAD pointing to the branch. use the directory tree pointing to branch to update the staging area and the git checkout summary of the workspace, the staging area, and the HEAD. git checkout-B Equivalent to git branch Git checkout Create and switch to a new branch, the new branch starts from the commit indicated by start_point to create git diff-workspace comparison staging zone git diff -- cached-staging zone comparison HEAD git diff HEAD-workspace comparison HEAD Git object git cat- file-p sha1 value view sha1 object content remote version Library git checkout-B Create a local branch from a remote branch to automatically create a trail. Git remote add Register the remote version Library git remote-v to view the registered remote version Library git push command explanation: 1. if you set , Is equivalent to git push 2. no settings , Equivalent to git push origin3. if you create a branch in the remote version Library, execute git push

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.