Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
279 views
in Technique[技术] by (71.8m points)

css - 如何在git中处理CSS和CSS?(How to handle scss and css in git?)

I'm very new to scss and css so please bear with me.

(我对CSS和CSS还是很陌生,所以请多多包涵。)

I've done some research but found conflicting information.

(我进行了一些研究,但发现信息冲突。)

I have 2 freelancers working on my project.

(我有2个自由职业者在我的项目上工作。)

Both freelancers make changes to:

(两位自由职业者都对以下内容进行了更改:)

style.css
style.css.map
style.scss

Everytime I merge their work I break the frontend.

(每当我合并他们的工作时,我都会破坏前端。)

How can I merge their work without breaking everything?

(如何在不破坏所有内容的情况下合并他们的工作?)

I read online that these files should not be included in GIT?

(我在线阅读了这些文件不应该包含在GIT中吗?)

I also read that I should used GULP or LESS?

(我还读到我应该使用GULP还是LESS?)

Apparently, I should compile the merged code before committing?

(显然,我应该在提交之前编译合并的代码?)

Seriously confused with the research.

(与研究严重混淆。)

How do I handle these files?

(我该如何处理这些文件?)

  ask by Boosted_d16 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The .css file is generated from the .scss files.

(.css文件是从.scss文件生成的。)

Your developers should commit only in the .scss files.

(您的开发人员应仅在.scss文件中提交。)

In the most cases the .css file is not added to the repository at all.

(大多数情况下,.css文件根本不会添加到资源库中。)

And you should not modify the .css file directly because it will be replaced with the next compilation of .scss the files.

(而且,您不应该直接修改.css文件,因为它将被下一个.scss文件编译所替换。)

GULP is just the tool that compiles the .scss files and create the css from them.

(GULP只是用于编译.scss文件并从中创建css的工具。)

Basically when using GULP you can create some functions where you can specify the input location(.scss), output location(.css) and additional rules, etc.

(基本上,使用GULP时,可以创建一些函数,在其中可以指定输入位置(.scss),输出位置(.css)和其他规则等。)

There are also other tools that can do this.

(还有其他工具可以做到这一点。)

Like Koala , Webpack .

(就像考拉一样, Webpack 。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...