Using SASS with Git, what files do I ignore and how?

git ignore
sass git ignore
gitignore not ignoring file
git ignore hidden files
git ignore untracked files
git ignore any file named
git ignore build folder
gitlab ignore files

I've got a framework in my /project directory, where I have multiple .sass-cache folders.

For example, I could have this

/project/-/-/one/.sass-cache

And this

/project/-/-/two/.sass-cache

And this

/project/three/.sass-cache

And I want to add all of the to .gitignore. I've tried this:

# Sass #
###########
*.sass-cache*

But it fails and git still picks up changes in them. How do I properly add my .sass-cache folders to my .gitignore file?

With .gitignore, a single asterisk is only a wildcard for a specific directory. If your git version is up-to-date, you should be able to use the double asterisk to indicate any level of subdirectories.

Single asterisk will only match files for that directories depth

foo/*/* == foo/bar/file.xyz
foo/*/* != foo/bar/dir/file.xyz
foo/*/* != foo/file.xyz

Two asterisks matches any directory depth

foo/** == foo/bar/file.xyz
foo/** == foo/bar/dir/file.xyz
foo/** == foo/file.xyz

For your case, I would suggest trying the following...

**/.sass-cache
**/.sass-cache/*

Lastly, I don't know if it would work, but you might also try...

**.sass-cache**

On this last one, I'm not sure how the double-asterisk would get interpreted. The two lines above this should work fine though.

.gitignore file, files are saved, or perhaps the wrong styles seem to be getting generated. Stack Overflow Public questions and answers; Teams Private questions and answers for your team; Enterprise Private self-hosted questions and answers for your enterprise; Talent Hire technical talent

I just use

.sass-cache
.sass-cache/*

And that seems to work fine.

Ignoring directories in Git repositories on Windows, Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, Find file Copy path. gitignore/Sass.gitignore. .sass-cache* tells Git to ignore any directory named .sass-cache. .css.map tells Git to ignore files named .css.map. Note that if your file is named differently it won't be ignored. A less specific rule like *.map might suit you better.

One more thing.You should add **.css.map in your .gitignore.

Clearing the Sass cache, A quick explanation of what .sass-cache and css.map are for: The .sass-cache .​css.map tells Git to ignore files named .css.map. How should my local file structure appear if I'm using git for software revision control? Through Git ignore, you can assign the temporary or transient files that you do not want to get commit. These files are useless for other developers and your projects like projects build or IDE temp files. Git-ignore can also include patterns which will tell Git a generalized version of the kind of files to ignore.

I'm using

.sass-cache/
*.css.map

as especified in github's gitignore descriptions (https://github.com/github/gitignore/blob/master/Sass.gitignore), it seems to work having .sass.cache files at whatever level in the project folder.

gitignore/Sass.gitignore at master · github/gitignore · GitHub, Each new line should list an additional file or folder that you want Git to ignore. The entries in this file can also follow a matching pattern. * is used  To untrack a single file that has already been added/initialized to your repository, i.e., stop tracking the file but not delete it from your system use: git rm --cached filename. To untrack every file that is now in your .gitignore: First commit any outstanding code changes, and then, run this command: git rm -r --cached .

How should SASS files be handled in a .gitignore file and why , I guess I am wondering if either the sass folder (containing scss files) or I generally ignore the css folder and definitely the .sass-cache folder. The .gitignore file is a text file that tells Git which files or folders to ignore in a project. A local .gitignore file is usually placed in the root directory of a project. You can also create a global .gitignore file and any entries in that file will be ignored in all of your Git repositories.

Gitignore Explained: What is Gitignore and How to Add it to Your Repo, When creating a project (e.g. Django), what is the best way to include Sass files in my VCS. Do I create a separate Git repo for Sass and then  I do have a .git-ftp-ignore file, but the source files are actually not in the the directory I'm tracking with git-ftp. I'm pretty sure they would be uploaded if they were, as any other file is uploaded when changed directly.

Using SASS with Git, I have a question regarding CSS files and Git in Laravel 5. Do Let's say I'm using sass, so all the "source code" should be in resources/assets/sass. If you'​re only using Git as a VCS then you can probably ignore public/css. A collection of useful .gitignore templates. Contribute to github/gitignore development by creating an account on GitHub.

Sass GIT best practices, What files should you push up into a Git repository? Now, let's take a look at common types of files we would ignore. For example, the sass gem produces a .sass-cache folder whenever it compiles Sass into CSS. managers can be re-​downloaded quickly by running one command (like bower install  I have set my .gitignore to ignore both .sdf files and .vcxproj but they still keep appearing at Git Extensions for me to commit them. Specifically the *.sdf are causing tons of conflicts as it keeps being updated by vs10, and it prevents me from pulling to my other workstation. Uploading 32mb each time is just not possible.

Comments
  • In case this still don't work, have a look at stackoverflow.com/questions/11451535/gitignore-not-working
  • **.sass-cache** worked for me in my perfect in my WordPress theme
  • I should add that my sass-cache directories are several directories deep compared to where the git ignore file is.
  • That sounds like it should work for me, but it doesn't look like it. Isn't there some kind of cached git tree that I need to clear to make it forget changes it might have already noticed in those directories?
  • Dang, I'm far from a git expert, but I have had success with the above config in my git ignore file. Would the answer here: stackoverflow.com/questions/5810233/… help?
  • This should be enough, but remember that if this directory has already been tracked, you'll need to untrack that directory. See if it's tracked with git ls-tree -r master --name-only. Untrack it with git rm -r --cached ./.sass-cache
  • Thanks for the untrack tip, that helped me.
  • How does this add anything over the existing answers?