git - Valid global .gitignore steps won't take effect on Mac OS -


i'm trying set-up global gitignore file on mac os reason doesn't take effect. when repeat same steps on linux os go fine. steps below do. point out i'm missing please?

note: committed .idea files before related it? in case tried adding .idea , .idea/* well.

steps

macbook-pro:~ bc$ echo $home /users/bc macbook-pro:~ bc$ git config --get core.excludesfile /users/bc/.gitignore_global macbook-pro:~ bc$ cat .gitignore_global *~ .ds_store .idea/ macbook-pro:~ bc$ git config --global core.excludesfile /users/bc/.gitignore_global 

project

macbook-pro:project bc$ git branch * develop   master macbook-pro:project bc$ git status on branch develop changes not staged commit:   (use "git add <file>..." update committed)   (use "git checkout -- <file>..." discard changes in working directory)      modified:   .idea/workspace.xml  no changes added commit (use "git add" and/or "git commit -a") 

git’s ignores (be local or global) pertain files have not been added index. once file part of repository, git continue tracking changes it, no matter current ignore list. need remove file index using

git rm --cached .idea/workspace.xml 

alternatively, can tell git keep tracking file ignore local changes using

git update-index --assume-unchanged .idea/workspace.xml 

Comments

Popular posts from this blog

python - Mongodb How to add addtional information when aggregating? -

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

java - Incorrect order of records in M-M relationship in hibernate -