处理git,生成的文件和Bower [英] Dealing with git, generated files and bower
问题描述
我知道将生成的文件提交到git存储库是一种不好的做法。但是如何应对凉亭?
I know that it is considered a bad practice to commit generated files to a git repository. But how to deal with bower?
当前,我的库内置在 dist /
目录中,而该目录被忽略。 gitignore
文件。我不想将生成的文件推送到存储库。问题在于该库还作为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.
当发布新版本时,如何将生成的资产引用到Bower组件中?我应该创建另一个存储库来存储那些文件吗?我应该将这些文件提交到git标签版本吗?
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?
推荐答案
您已经提到了选择。确实没有最好的方法。选择您喜欢的。创建一个新的仓库或提交 / dist
文件夹。两者都有优点和缺点。创建回购协议使更新变得更加麻烦,提交使回购协议更加膨胀。
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.
Bower团队正在研究一种将发行版发布到服务器的方法,该解决方案可以解决这个问题。
The Bower team is working on a way to publish releases to a server, which will resolve this issue.
这篇关于处理git,生成的文件和Bower的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!