简体   繁体   English

如何反转未提交更改的 git diff 输出?

[英]How to reverse the git diff output for uncommitted changes?

I have some uncommitted, unstaged changes which I want to create a patch from, but also flip the + and - lines.我有一些未提交的、未分阶段的更改,我想从中创建补丁,但也要翻转+-行。

git diff shows a change like: git diff显示如下变化:

-apple
+orange

I want it to be like我希望它像

+apple
-orange

but without committing the changes and then using a git diff commita..commitb但没有提交更改,然后使用git diff commita..commitb

git diff -R

-R表示“反向”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM