Search code examples
gitgithub

storing sources and build files in git


I'm working on some library which I want to share through github. I have watch gulp task that concatenate all my library *.js files into one and put it in build folder each time I made a change somewhere in sources. So currently in repository I have both sources and concatenated file. The problem with my current approach is that each time commit made it can be seen twice in history - as change somewhere in source files and as change in build file. What are the best way of handling such libraries in git repositories?


Solution

  • I would recommend removing the concatenated javascript file from the git repository using git rm {file.js} and then add that file to .gitignore From then on, you should only commit the changes to the files that you actually touched, and don't track the autogenerated files in git anymore.