First, Git deployment
[Official website address] https://git-scm.com/
[download] CSDN
All in accordance with the default installation is ~
Second, common operations
1, the deployment of code repository
Configuration status:
git config --global user.name "用户名"
git config ---global user.email "邮箱地址"
Create a code repository:
git init
2, submitted to the local code
Add code to submit:
git add 文件名/目录名
Add all of the files:
git add .
Submit code:
git commit -m "要备注的信息"
3, ignore files
There is a directory named under the code .gitignore
file, the contents of which are not added to version control:
4, modify the content view
Check the revision of the file:
git status
Compare file changes:
git diff 文件名
5, the revocation of uncommitted changes
Undo file is not added:
git checkout 文件名
Undo last 已添加
state:
git reset HEAD 文件名
7, see the commit record
View historical submit information:
git log
View one record:
git log ID -1
View details:
git log ID -1 -p