git - How to push on the production server only folder prepared for production? -


i have project under git version control. file structure following:

.git build server   models   controllers   views site   css   js   img .gitignore 

in 'server' , 'site' folders resides source code unprepared production. use grunt preparing js css production (concat , min) put prepared files production in 'build' folder, after grunt this:

build   server     models     controllers     views   site     css  // min     js   // min     img  // sprites 

after 'git commit' , 'git push' remote production server. build folder git push source code ('server' , 'site' folders outside build folder) .that correct because git versioned files under application folder. need exclude pushing these folders pushing server.

how can that. thanks!

i thing have branch release. let's have branch production it's own .gitignore file push need.

the way did this

mkdir project cd project git init vi .gitigore type , save git commit -a -m "first commit" git checkout -b release vi .gitignore change content of file git commit -a -m "update release" 

and that's it:-)


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

css - Text drops down with smaller window -