1, Git combat
What is Git
- Git is a distributed version control software.
- Software, similar to QQ, office and other tools installed on your computer in order to use;
- Version control, similar to the thesis, writing copy, video clips, etc., need to repeatedly modify and retain the original historical data;
- Distributed
- copy the folder
- a local version control
- Centralized version control
- Distributed Version Control
Install Git
online installation tutorial, download links are as follows:
Git for Windows
2, Git learning
The first stage: write code
version control
To manage the folders into the
right-Git Bash Here
1. Initialization
git init
2. The state file management directory
git status
3. Manage the specified file
the Add index.html git
git the Add. (Adding to manage all modified files)
Personal Configuration: user name, email
git config --global user.email "[email protected]"
git config --global user.name "the Name Your"
4. Generate version
Status Git
Git the commit -m 'description'
5. View version
git log
The complete process is as follows:
The second stage: to explore new features
the Add git
git the commit -m "v2 version"
The third stage: Rollback feature
1. Before you roll back to version
log git
git version number of the RESET --hard
2. After the rollback version
reflog git
git version number of the RESET --hard
3, summary
Git three regions (important)
files 1. Modifications (red state) changes back to normal status
, ie: workspace -----> staging area
Checkout git
git Checkout - - name of the file
note the file name in front of a space
2. Managed File (green state) changes back are subject to change file (red state)
namely: the staging area -----> Workspace
the RESET the HEAD git
git the RESET the HEAD file name