文章目录
- Git相关命令
Git相关命令
git init
:初始化本地git目录,生成 .git 文件夹
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo
$ git init
Initialized empty Git repository in C:/Users/97351/Desktop/demo/.git/
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo (master)
$ ls -a
./ ../ .git/
git add
:git add命令将文件内容添加到索引(将修改添加到暂存区)。也就是将要提交的文件的信息添加到索引库中。
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo (master)
$ touch 1.html
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo (master)
$ git status -sb
## No commits yet on master
?? 1.html
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo (master)
$ git add 1.html
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo (master)
$ git status -sb
## No commits yet on master
A 1.html
git commit -m 消息
:提交,提交信息为-m后面这段信息
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo (master)
$ git commit -m 11111
[master 4af636d] 11111
1 file changed, 1 insertion(+)
git commit -v
:提交,并启动vim,显示本次有哪些修改。
97351@DESKTOP-GV90EHG MINGW64 ~/Desktop/demo (master)
$ git commit -v
C:/Program Files/Git/usr/bin/vim: C:/Program: No such file or directory
error: There was a problem with the editor 'C:/Program Files/Git/usr/bin/vim'.
Please supply the message using either -m or -F option.
我的vim好像出了点问题。需要重新安装。修复后再重新上图!