git命令使用:提交前可指定要提交哪些文件,然后使用git commit来提交

样例:

git status

输出:

Changes to be committed:

modified:   app/Library/Common.php

 

Changes not staged for commit:

modified:   .env

modified:   index.php

 

Untracked files:

.idea/

 

如果你想加入本次要提交的文件,使用命令:git add index.php

然后index.php会出现在Change to be commited一栏下面

 

最后使用git commit -m 'commit message'来提交。

这里一定要注意,千万不能使用:git commit . -m 'commit message'。"git commit ."会把当前的所有修改提交到本地版本库

 

相关文章:

  • 2022-01-29
  • 2021-07-12
  • 2021-06-29
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2022-01-12
  • 2021-07-01
  • 2021-07-16
  • 2021-08-23
相关资源
相似解决方案