I'd like to know all distinct extensions of files tracked by git in a given repo, in order to create appropriate .gitattributes
file.
Example output expected:
bat
gitignore
gradle
html
jar
java
js
json
md
png
properties
py
svg
webp
xml
yml
What command can I use for that?
When you declare it as an alias, you have to escape
$1
:This is better than naive
find
, because:.git
directory which contains usually hundreds/thousands of files and hence slows down the search(inspired by How can I find all of the distinct file extensions in a folder hierarchy?)