MMU
MMU

Reputation: 11

Git command to get SVN style diff; modified file list between revisions

I used the command "git diff --name-only" and got output like below

FilePath/FilePath/FileName.ext
FilePath/FilePath1/FileName1.ext

I need SVN style output like

M FilePath/FilePath/FileName.ext
A FilePath/FilePath1/FileName1.ext

How to achive this?

Upvotes: 1

Views: 59

Answers (1)

G. Sylvie Davies
G. Sylvie Davies

Reputation: 5517

Try the "--name-status" option instead of "--name-only":

git diff --name-status

Example output:

git diff --name-status HEAD~1 HEAD
M       .gitignore
A       src/File1.java
A       src/File2.java
M       src/File3.java

Upvotes: 1

Related Questions