Monday, 15 April 2013

git diff --name-only with no file paths -



git diff --name-only with no file paths -

how execute next command getting filenames without paths?

so, literally, command says, "name-only" - not file paths, file names.

git diff --name-only <commit> <commit>

afaik not provided git since pretty unusual requirement. illustration first seek in repository yielded dozen lines, each saying pom.xml because created new version.

you can utilize little script though. basename friend here.

i xargs i'd this

git diff --name-only <commit> <commit> | xargs -n1 basename

this fail if git diff provides no output.

or loopy version

for s in `git diff --name-only <commit> <commit>` ; basename $s ; done

git git-diff

No comments:

Post a Comment