Captain Obvious Captain Obvious - 1 year ago 70
Git Question

GIT workflow development (all files) vs production (partial files)


1 GIT repository which contains client/server/shared code, currently on 1 branch.

Build process:

  • The client is a web-based application and needs to be
    minimized/bundled/etc, which results in one file

  • The server
    remains the same for now, although it might be bundled later on


I do not want all files to be on my production server, just the bundled version of the client and the server folder. If I would pull the master branch in, I get all files and not just the bundled version.


??? - How do I have to handle this? Create additional repository, create multiple branches? How is this typically done?

Answer Source

Typically you would like to separate your Source Control, build process and deployable artifacts. Git is primarily for Source Control, the accepted practice is to only have source code in it.

Then you would have it built with some build tool (Jenkins, bamboo etc.) Then you can either use the build result from the build tool, or if you prefer use a version control for your artifacts like Nexus or artifactory.

This may sound complicated, but does avoid a lot of problems in future.