通常,我的工作流程是更改代码中的某些内容,并在终端机(mac)中使用git提交。 1.代码变更 2.i执行“ git status”以查看发生了什么变化
modified: server/src/main/java/com/ipkiss/sampleProject/sampleCode.java
modified: server/src/main/java/com/ipkiss/sampleProject/sampleCode2.java
modified: server/src/main/java/com/ipkiss/sampleProject/sampleCode/somepackage/sample3.java
3.i执行“通过复制并粘贴完整路径进行git添加操作,或者我必须键入所有内容,如果更改的文件像一两个文件,则很好,但是当我不止一个时,它会大量复制和粘贴查看状态,比较并提交一个特定文件。
提交和查看差异非常酷,而且非常快 如果我可以在git diff,git status或git commit上看到类似这样的内容来提交特定文件。
[1] modified: server/src/main/java/com/ipkiss/sampleProject/sampleCode.java
[2] modified: server/src/main/java/com/ipkiss/sampleProject/sampleCode2.java
[3] modified: server/src/main/java/com/ipkiss/sampleProject/sampleCode/somepackage/sample3.java
那我就能做到
git diff 1
git commit 1
代替
git diff server/src/main/java/com/ipkiss/sampleProject/sampleCode.java
git commit server/src/main/java/com/ipkiss/sampleProject/sampleCode.java
有没有办法做到这一点?