Git diff doesn't ignore specified files in .gitignore -


i'm new git , have no idea i'm doing wrong. want run git diff --name-only want exclude files ending in .test meaning if these haves have changed, don't want git diff output it's changed. tried add these file .gitignore files did include .gitignore when run git diff command!

what doing wrong , how exclude files when run git diff?

okay, did wrong. git continue track files because started tracking them earlier in project. @ point earlier did run initial commit looked like:

git add . # added tracking system including .test files git commit -a -m 'i committed in project .test files included' 

putting things gitignore file keep future files create end in .test entering project, need remove .test files told git track git's memory. putting things in gitignore not preform action tracked files. need this:

option 1:

# can remove files gits tracking system , put them # when go put them git have no memory of tracking these # , consider future edits ignored # .test files before doing this, , delete them project git rm /path/to/your/file.test 

option 2:

# safer not use gitignore @ git update--index --assume-unchanged /path/to/your/file.test 

when run option 2 telling git rest of time file never changing (even when in real life) let keep .test files part of tracked project (as now), git never bother changes them ever again. note operation can undone @ time , not destructive, why safer. should go read on before use it.

https://www.kernel.org/pub/software/scm/git/docs/git-update-index.html


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -