GET common commands

Global 1.GIT configuration

$ Git config - l to check the configuration
$ git config --global -l to view the global configuration information

2. Configuration:

$ git config --global user.name 'xxx'
$ git config --global user.eamil 'xxx'
clear : 清屏

3. Create Warehouse:

$ Git init // will generate a hidden folder (.git: Information staging area and the historic district, etc.)

4. submitted to the staging area:

$ Git add xxx submit a file to the staging area
$ git add all submitted files that have changed the current warehouse to the staging area.
State $ git status to view the current file (red: In the workspace, green: Temporarily memory area, no: the historic district)
$ git RM - cached xxx: xxx remove the file from scratch

5. Submit to the historical district

$ Git commit -m'xxxx '// xxx: Description
$ git log // View Historic District Information
$ git reflog // version history information (including fallback version)

6. version rollback:

$ Git reset --hard xxx // xxx is to roll back the version number

7. uploaded to the central warehouse:

$ Git remote -v // Check local warehouse and central warehouse connected state
$ git remove add origin [GIT repository address]
$ git Remote RM Origin // unlink orgin central warehouse for the name

$ Git pull origin master // got me from the central data warehouse (github need to enter a password)
$ git the Push Origin Master // uploaded to the central warehouse

$ Git clone [central warehouse address] [alias]

Guess you like

Origin www.cnblogs.com/zoukun/p/12114192.html