Say I have a directory "my_dir" and some files in it. And I have a subdirectory in it "my_dir_subdir".
File structure: "my_dir/my_dir_subdir".
How to track my_dir via git LFS but not track "my_dir/my_dir_subdir/" via git LFS
Configuring ignored files for a single repository You can create a . gitignore file in your repository's root directory to tell Git which files and directories to ignore when you make a commit. To share the ignore rules with other users who clone the repository, commit the . gitignore file in to your repository.
Git will only track Files and the changes in them. So folders are tracked as part of the file changes in them. In order to create an empty folder and commit it, there have to be some files inside it.
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
Seems like you can disable a certain rule with preceding it with a hyphen:
*.png filter=lfs diff=lfs merge=lfs -text
Dependencies/*.png -filter=lfs -diff=lfs -merge=lfs -text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With