While VonC's answer is definitely correct and will help with the inevitable problem, I feel the need to develop and explain the underlying problem.
Background
Git sparse-checkout uses the skip-worktree bit , which basically tells git to consider the file in your working directory will be "up-to-date", regardless of the true state.
When using sparse-checkout git, this bit will be applied to all files that do not match the patterns described in your sparse-checkout file. If you disable sparse-checkout or delete the template file, these bits will still be set and the files will not be returned. You can read about it here.
Thus, you must remove the skip-worktree manually from the corresponding files. The simplest approach, of course, is the VonC proposal.
But why?
The rationale for this is quite simple. The skip-worktree not used exclusively for sparse-checkout , but rather as a tool in the git toolbox. Other processes use the same bit, or the user can even use it on their own (I personally use it regularly to ignore changes in configuration files when debugging).
In the side pointer . In fact, you can get a list of files marked as skip-worktree bits using git ls-files -v . This will display all files under version control; files with the skip-worktree are prefixed with S
If you only want to list the skip-worktree with the flag, you can easily parse the grep list with the following command: git ls-files -v | grep '^S' | cut -d' ' -f2 git ls-files -v | grep '^S' | cut -d' ' -f2 git ls-files -v | grep '^S' | cut -d' ' -f2 .
source share