Dealing with git, generated files and bower

别说谁变了你拦得住时间么 提交于 2019-12-11 04:07:43

问题


I know that it is considered a bad practice to commit generated files to a git repository. But how to deal with bower?

Currently my library is built into a dist/ directory which gets ignored by a .gitignore file. I don't want generated files pushed to the repository. The problem is that the library is also distributed as a bower component.

How can I reference the generated assets into my bower component when a new version got released? Should I create another repository to store those files? Should I commit those files to the git tagged version?


回答1:


You've already mentioned your choices. There aren't really a best way. Choose what you prefer. Either create a new repo or commit the /dist folder. Both have upsides and downsides. Creating a repo makes it more cumbersome to update and committing makes the repo more bloated.

The Bower team is working on a way to publish releases to a server, which will resolve this issue.




回答2:


I would like to challenge the idea that committing built files is a bad practice, and I do that in this question.

About handling built files with git, check also this excellent post.



来源:https://stackoverflow.com/questions/19029726/dealing-with-git-generated-files-and-bower

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!