git distributed, collaborative development
git hub server
A. Advantages of using version control tools
A) The development process of the software can be seen
b) The operation can be restored by mistake
B. How to use git to manage source code
1. Create a git repository yum install git git version view version
2. tell git the name and the mailbox git config--global user.name "yogurt" git config--global user.email "[email protected] "
3. initializing the repository git init rename ( working directory )
4. Add Command adds file to repository git Add file name, can be used repeatedly, add multiple files
5. Commit file to the repository git commit-m " write it anywhere "
6. Status time to master the current state of the repository git statuses
On Branch Master No to commit means there is no need to raise price changes, working directory clean
7. diff View different points of the file
8. Log View change history git log
parameter --pretty=oneline
display format: commit ID ( version number ) notes
9. Git Reset--hard head^
head^ represents the current version, head^^ the first version
principle:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/28/wKiom1cVHVqjfCWfAAFW_EDqW-Q587.jpg "title=" 14591829364304.jpg "alt=" Wkiom1cvhvqjfcwfaafw_edqw-q587.jpg "/>
10.reflog git reflog record every command
git reset--hard ID(first column) can go back to the future
11.checkout can discard modifications to the workspace
format git checkout-- file name
bring the file back to the nearest
This article is from "Doyle" blog, please make sure to keep this source http://conandoyle.blog.51cto.com/11462365/1765239
Git basic usage