0

I try to ignore a folder with git update-index --skip-worktree command, but it cant mark to S (skip-worktree) files under the folder until i remove git cache. git rm -r --cached

When i check files with git ls-files -v all of them still mark with H. If i remove git cahce, this time, it removes all files from local which are need to be mark S, and files wait in stage to commit.

I try to gitignore_global but same thing is happen. I need untrack the folder directory without removing cache or push anything to remote. Is it possible ?

erkan demir
  • 1,386
  • 4
  • 20
  • 38
  • Can you explain a bit more what you are trying to do? In my understanding "untracking files" means to `git rm --cached files... && git commit -m 'untracked files'`. An untracked file is a file that's not being tracked in Git history. And if it already exists in Git history, you need to first remove it from there. – knittl Feb 15 '22 at 19:24
  • @knittl These files are generated in build time. i don't want these files to appear modified in unstage. Collaborates can pull files from remote. But only in my local i need to exclude these files. If i remove cache, i have to commit and push them as deleted. But should not be deleted on remote. – erkan demir Feb 15 '22 at 20:15

1 Answers1

3

It sounds like what you want to do is ignore tracked files, and as the Git FAQ mentions, Git has no way to do that. git update-index is specifically mentioned by the FAQ as not working for that purpose.

If you have build files, they shouldn't be checked into the repository. Git is not an asset store, and not checking build files into the repository will prevent them from being modified when you rebuild.

bk2204
  • 64,793
  • 6
  • 84
  • 100