[Git] Use git add --patch for better commit history and mitigating bugs

Posted Answer1215

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Git] Use git add --patch for better commit history and mitigating bugs相关的知识,希望对你有一定的参考价值。

Let‘s split our changes into separate commits. We‘ll be able to check over our changes before staging them all from the terminal. Then, we‘ll see the positive effect it has on our commit history.

 

git add --patch

 

1. Then in the cmd, we can type ‘s‘ stands for splite the changes into chunks.

2. Then type ‘q‘ stands for quite.

3. Add commit message for that part of changes

4. Then run git add --patch

5. Repeact 1-4 until all changes are included

 

以上是关于[Git] Use git add --patch for better commit history and mitigating bugs的主要内容,如果未能解决你的问题,请参考以下文章

使用 git add --patch <filename> 手动编辑

如何在 git add --patch 中使用 --color-words?

如何在 git add --patch 中使用 --color-words?

`Git add --patch` 多个文件:从上一个文件转到大块

如何使用寻呼机进行长 git add --patch hunks?

git am 合并 patch 时冲突的解决方法