1

I am trying to make static content path at build time using by maven

but I can't find maven plugin with git. In svn, I can make path using by svn-revision-number-maven-plugin.

svn-revision-number-maven-plugin can retrieves the status and revision number of a file or a directory under the Subversion version control.

If you know good solution, could you share me please?

magnus
  • 11
  • 3

1 Answers1

1

First lets explain why you can do in SVN and not with git.

SVN store changes made per directory so you can get revision per directory or file.
Git does not store information per file or directory. git does not care what is the name of your file at all. Git store snapshots and the file names are not stored along with the data.

If you wish to learn more about it read this post: How does git status work internally?

So to make a short answer yo cant do it directly buy you can write a script or a java code which execute git commands

# get all the SHA1- of all files in the current HEAD
# Use grep to extract the one you are looking for
git ls-tree HEAD  | grep path
Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • Cool, Glad to help, feel free to ask for any required information. You also should accept the answer. This is how it work on this site. – CodeWizard May 02 '16 at 07:28