Common git directives

Source: Internet
Author: User
Tags git clone repository

9. Common git directives
    • git help:git instruction help manual
    • To view other directives: git help other instructions

    • Git config:git configuration information (the. git/config file is modified)
    • Configure user name: Git config "user.name" username (for tracking Change Records)
    • Configure mailbox: Git config "user.email" mailbox (for communication between multi-person development)
    • View configuration information: Git config–l
    • Edit configuration information: Git config–e (edited with Vim: Wq is exiting the VIM editor)
    • Set the alias of the directive: Git config alias. Alias original instruction Name
    • To set an alias with a parameter directive: Git config alias. Alias "original directive name parameter"
    • Apply this setting to the entire system: Git Config––gloabal
    • Git init: Initializes an empty local repository and generates a. git directory for maintaining version information
    • Initialize repository at current path: Git init
    • Initializing warehouses in other paths: Git init warehouse path
    • Git add: Save the workspace file to the suspend zone
    • Save a file to a pending area: Git Add file name
    • Save all files of the current path to the Suspend zone: Git Add. (Note that the last is a point.) )
    • Git commit: Submits the file of the deferred zone to the current branch
    • Commit a file to a branch: git commit-m "comment" file name
    • Save all files from the current path to the branch: Git commit-m "Comments"
    • Git Reset: Version fallback (recommended with ––hard parameter, Git supports unlimited regrets)
    • Fallback to previous version: Git Reset––hard head^
    • Fallback to the previous version: Git Reset––hard head^^
    • Fallback to top N versions: Gitreset––hard head~n (n is an integer)
    • Fallback to any version: Git reset––hard version number (version number with 7-bit)
    • git reflog: View instruction usage record (ability to view all version numbers)
git rm: Delete files (commit after deleting, to sync to Repository
    • git clone download remote repository to local
    • Download remote repository to current path: URL of the git clone repository
    • Download remote repository to a specific path: The URL of the Git clone repository stores the path to the repository
    • Git pull: Download the latest information from the remote repository to the local repository
    • git push: Pushes local repository information to the remote repository

Common git directives

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.