StuperUser
StuperUser

Reputation: 10850

Can I ignore .css files while running >$ git mergetool?

Our project has .scss file which we generate to .css and the generated .css files are stored in the repo.

There's no point merging our entire site's .min.css or .css.map.

When running $ git mergetool, can I configure it to ignore these files, whether by directory or file name or file extension?

Upvotes: 1

Views: 466

Answers (1)

Naveen Dennis
Naveen Dennis

Reputation: 1223

You can add

.min.css
.css.map

to you .gitignore file. After commiting the .gitignore file with these entries you can ignore the files that have already been pushed by executing the following command

git rm -r --cached
git add .

What the above commands do is that they refresh the index file which contains your already published .min.css, .css.map files (filtered -- sortof) And then commit again after the above two commands to delete the files that are generated.

Using Git Attributes, it is possible to ignore remote changes during merge. More details are provided in the link below -

http://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Merge-Strategies

Upvotes: 1

Related Questions