I have a private Git repo that I cannot make public. I like to generate diff from my commits and ask outsider if my commits are good. To make him review my commit easy, I like color (red/green) to be applied to where my changes are. How can I save diff to a file?
Asked
Active
Viewed 4,770 times
4
-
1`git diff > changes.diff` - if you use the `.diff` extention, some editors will give you the color highlighting - `.patch` may also work - depends on what you're using – Robbie Mar 08 '17 at 19:49
-
Possible duplicate of [Git Diff output to file preserve coloring](http://stackoverflow.com/questions/9706492/git-diff-output-to-file-preserve-coloring) – Robbie Mar 08 '17 at 19:54
1 Answers
6
"git format-patch HEAD~" creates a diff for the last commit that you can send through email or as a file.
You can see more options on: https://git-scm.com/docs/git-format-patch
Markus Mauksch
- 377
- 1
- 9