0

My problem here that i get a list ignore files,dirs but they still be available for committing.

For example: I just remove cache by command:

git rm --cached *DATN_2015.BLL.dll

git commit -m "Delete some files from repository"

so i get all these files and commit to remove > push. Then, i update my file:

.gitignore

with:

*DATN_2015.BLL.dll

but i don't know why when i rebuild project's solutions, they appear a new change for this file DATN_2015.BLL.dll and it still be available for committing.

1 Answer 1

2

What .gitignore is doing, is ignoring new untracked files to the repository.

Make sure your .gitignore is at the root of your repository (next to the .git).

If you want to ignore changes made to already tracked files, use this command :

git update-index --assume-unchanged <file>

More informations here.

4
  • so, i can't ignore these files: upsieutoc.com/images/2015/07/20/Captureb2cfe.png I use your command, it's worked on first time, but when i rebuild solution, they appear again Jul 20, 2015 at 13:50
  • First you need to remove them using git rm --cached, and commit that change. Then, your .gitignore changes will be applied.
    – blue112
    Jul 20, 2015 at 13:51
  • thank you blue but it still not work, do you have skype ? .gitignore just ignore my new folder directories, i have tried: 1. Add ignore file list to .gitignore 2. Remove cache file list by rm --cached myfiles 3. Commit and Push 4. Try to use your command and it's ok on my first use, but still appear after i rebuild solution, still available for committing. Jul 20, 2015 at 13:57
  • Sounds like there's something you're doing wrong. Please ask a new question on stack overflow with all the relevant code copied from your terminal, like your .gitignore file and your git status.
    – blue112
    Jul 20, 2015 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.