Skip to main content
silent git status
Source Link
Top-Master
  • 9k
  • 6
  • 52
  • 97

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, anywhere (in Git-bash) run:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} 2>/dev/null | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or its sub-dirs).
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Another useful thing is Human-readability, like if an entire directory is ignored, something like build or node_modules, this will log dir-name only.
While git ls-files --others -i --exclude-standard command logs each and every file (good for xargs).

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, anywhere (in Git-bash) run:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or its sub-dirs).
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Another useful thing is Human-readability, like if an entire directory is ignored, something like build or node_modules, this will log dir-name only.
While git ls-files --others -i --exclude-standard command logs each and every file (good for xargs).

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, anywhere (in Git-bash) run:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} 2>/dev/null | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or its sub-dirs).
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Another useful thing is Human-readability, like if an entire directory is ignored, something like build or node_modules, this will log dir-name only.
While git ls-files --others -i --exclude-standard command logs each and every file (good for xargs).

grammar
Source Link
Top-Master
  • 9k
  • 6
  • 52
  • 97

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, run anywhere (in Git-bash) the commandrun:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or it'sits sub-dirs'dirs).
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Maybe anotherAnother useful thing is thatHuman-readability, like if an entire directory is ignored, something like build or node_modules, this will log dir name-name only.
While git ls-files --others -i --exclude-standard command logs each and every file (good for xargs).

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, run anywhere (in Git-bash) the command:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or it's sub-dirs').
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Maybe another useful thing is that, if an entire directory is ignored, something like build or node_modules, this will log dir name only.
While git ls-files --others -i --exclude-standard command logs each and every file.

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, anywhere (in Git-bash) run:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or its sub-dirs).
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Another useful thing is Human-readability, like if an entire directory is ignored, something like build or node_modules, this will log dir-name only.
While git ls-files --others -i --exclude-standard command logs each and every file (good for xargs).

added more details
Source Link
Top-Master
  • 9k
  • 6
  • 52
  • 97

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, run anywhere (in Git-bash) the command:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or it's sub-dirs').
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Maybe another useful thing is that, if an entire directory is ignored, something like build or node_modules, this will log dir name only.
While git ls-files --others -i --exclude-standard command logs each and every file.

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, run anywhere (in Git-bash) the command:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or it's sub-dirs').
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

If you just need a valid list of files ignored (no matter how they got ignored), and without any extra notice and logs.

Once created, run anywhere (in Git-bash) the command:

git ignore-list

Create it by executing:

git config --global alias.ignore-list "! cd -- \"\${GIT_PREFIX:-.}\" && git ls-files -v \${1:-.} | sed -n -e \"s,^[a-z] \(.*\)$,\${GIT_PREFIX:-./}\1,p\" && git status --ignored --porcelain \${1:-.} | sed -n -e \"s/^\(\\!\\! \)\(.*\)$/\2/p\" #"

Example usage, Assuming it's the initial commit and you want to push everything, try:

git ignore-list | xargs git add -f

Notes:

  1. It's tested and works on both macOS and Windows platforms!
  2. Once you cd into a directory, lists only files ignored from that dir (or it's sub-dirs').
  3. And lastly, always logs paths relative to root-dir (which contains .git dir, no matter what dir you cd into).

Maybe another useful thing is that, if an entire directory is ignored, something like build or node_modules, this will log dir name only.
While git ls-files --others -i --exclude-standard command logs each and every file.

added more details
Source Link
Top-Master
  • 9k
  • 6
  • 52
  • 97
Loading
clarified example
Source Link
Top-Master
  • 9k
  • 6
  • 52
  • 97
Loading
Source Link
Top-Master
  • 9k
  • 6
  • 52
  • 97
Loading