1.Git installation
2. Set git login information
3.git operation command
4. Submit sequential process several command code
5.git learning materials.
1.Git installation
Git Download: https://git-scm.com/download/win
After installation is complete, find the right mouse button in the "Git Bash Here", a pop-up window similar to the command line, it shows Git installed successfully!
After installation is complete, you can use the git.
2. Set git login information
Enter the following command in the above Git Bash command window, the name and email replace their own:
git config --global user.name "Administrator"
git config --global user.email "[email protected]"
3.git operation command
git commands a lot, I used generally have the following.
clone git : copy to a local Git repository, so that they can view the item, or amendments
Usage: git clone [url]
the Add git : add the file to the cache
Status git : view the current status of the project.
git diff: execute git diff to see the details of the implementation of the results of the git status. git diff command displays the write cache and write cache but has not yet distinguish changes has been modified. git diff There are two main scenarios.
Yet caching changes: git diff
View cached changes: git diff --cached
View cached and non-cached all changes: git diff HEAD
Displays a summary rather than the entire diff: git diff --stat
git commit : Use git add commands to the snapshot of the content you want to write buffer, and execute git commit will add content to the buffer warehouse
log git : View Submission History
pull git : to drag a version from a remote git repository, and merge into a local branch
git push: the modified and pushed to the local branch and a distal branch merge
4. Submit sequential process several command code
Code submission process in order to avoid the emergence of inexplicable error, we must follow the following order
Because: 1. there is sure to put a local warehouse code before pulling the distal end of the code, or the code may be washed away.
2. Prior to the native code is pushed to the distal end, we must first pull (ie, pulling the distal end of the code and native code merge), without first pull, push once the code with the remote code conflict, to solve the problem It will be quite troublesome.
So: The following sequence must press operation.
- git add // code to the cache
- git status // Check status, if the code to add to the cache has been added successfully
- git commit -m "Description of Change" // Code submitted to the local repository
- git pull // pull the distal merge code, and resolve conflict
- git push // push the distal end of the code combined
5.git learning materials
https://www.cnblogs.com/angel88/p/8194014.html
https://www.liaoxuefeng.com/wiki/896043488029600/896067074338496