闫刚 附加项目 git的使用技巧

我们编写git commit 每次会出现尴尬的局面,就是在写commit的时候,仅仅可以写一行commit. 

1. commit是git的提交记录

2. git的commit的编译器默认是nano, 可能很多人用的不习惯,我们现在修改成vi

git config --global core.editor vim

3. 使用过程

3.1 已经更改的文件,变成了no staged,需要通过git add ,提交更改的文件放到暂存区

$git add xxxx

3.2 输入命令,准备进入vi编辑器

$git commit 

3.3. 编写完成后,保存退出.

commit 9043bd64a5303d7ea53931c5356f36db1893c4cc (HEAD -> test)
Author: yangang <[email protected]>
Date:   Wed Jan 16 16:00:54 2019 +0800

    1. 更新a.c文件
    2. 更新b.c文件

猜你喜欢

转载自blog.csdn.net/yangang185/article/details/86509732