当前目录下创建新仓库git init gitlearning
进入目录cd gitlearning
配置仓库user.name user.email
git config --local user.name 'lula'
git config --local user.email 'admin@coding.lula.fun'
创建README.mdtouch README.md
尝试commitgit commit -m'Add readme'
报错,因为还没有track该文件
On branch master
Initial commit
Untracked files:
README.md
nothing added to commit but untracked files present
addgit add README.md
查看当前的状态git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.md
重新commitgit commit -m'Add README.md'
成功
[master (root-commit) 9a4b5ae] Add README.md
1 file changed, 112 insertions(+)
create mode 100644 README.md
查看git日志git log
commit 9a4b5aefbf519f1c3cc9939321cb62721d8889d8 (HEAD -> master)
Author: lula <admin@coding.lula.fun>
Date: Sun Jul 12 10:37:26 2020 +0800
Add README.md