github - How to ignore the contents of a previously tracked directory in git? -


i have seen this post no longer tracking tracked file, here situation.

i committed directory. want untrack in directory still track directory itself.

i have added /auto-save-list/* .gitignore file (the directory trying ignore auto-save-list directory in root of project, , have run git rm --cached still have multiple filed directory show new when go make commit. files show in origin repo.

can me ignore contents of tracked file?

this should enough:

git rm -r --cached auto-save-list/ echo "/auto-save-list/" > .gitignore git add .gitignore git commit -m "records untracking of /auto-save-list/ folder" 

no need '*'

if still need directory there (versioned in git repo, though git doesn't track empty folder), add dummy file in it.

touch auto-save-list/.keep git add -f auto-save-list/.keep git commit -m "record auto-save-list/ folder, while ignoring content" 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -