Advantages and drawbacks in committing built files in web develoment

A lot of people keep saying that it is a bad practice to commit built files in a repository, but i find that not doing it leads to a lot of troubles.

I also think that this has to be reconsidered given the strong advantages that build files provide in deploying generic web content.

  • Git with artifactory
  • How to push changes to Git repository from uninitialized directory
  • Getting Bower to like proxy firewalls
  • bower registering local git package
  • How Can I Seamlessly Use A Local Bower Dependency?
  • git: create tag and push to remote: why tag is behind master on remote?
  • A few context notes:

    • using git
    • developing for the web
    • developing for software modularity, so no giant code monoliths involved
    • developing for reusability, and possibly sharing as free software
    • by built files i mean textual files like compiled HTML, CSS or Javascript, not binary files

    In this context, committing built files strongly simplifies the deployment process, allowing easy deploying with just a static server, and thus:

    • easy local set up of the project also for the non technical
    • deployment does not require build dependencies
    • easy deploy and demo on github gh-pages
    • making built assets reusable by who references the repository with bower
    • easier troubleshooting of build errors among members of a team

    There are several means of configuring git in order to make built file handling more convenient, and not by accident they are often using by people working with style compilers or javascript transpilers. Compiled files used to be binary in the past and i can agree in that case to not commit them, but in web development we are daily building a lot of text files and they are so conveniently moved around with their source inside the same git repo.

    At this point, if no disadvantages can be found, saying that committing built files is bad practice becomes just an unreasonable dogma.

    So what are the actual drawbacks in committing built files? What are, on the other end, the advantages?


    Related questions:

    • Dealing with git, generated files and bower
    • Why check in bower components?

  • How to tell who was the author of removed line?
  • What exactly does the “u” do? “git push -u origin master” vs “git push origin master”
  • git am/format-patch: control format of line endings
  • What is the best way to keep javascript libraries up-to-date in rails?
  • Xcode error message “The remote repository rejected commits” when pushing to Github
  • When creating a git repository that will be on the server, can I convert it to a bare repository?
  • Git Baby is a git and github fan, let's start git clone.