Git with Kentico 10

Ashutosh Pandey asked on March 24, 2020 07:59

Hi, I'm struggling with using GIT with Kentico

The code we develop can be created in following ways:

  1. We create our own custom web parts, modules etc. (the code is generated by us, registered in Kentico)
  2. We create custom tables, page types etc. from admin (the code is generated by Kentico, DB changes as well)

Now, we cannot simply commit all the changes and pull on production server as it will fail. So, we need to maintain note of all the changes we made and then do all the steps on production server as well.

Is there method which ensure we update production using GIT only?

Also, we were working on branch: stable_production

I used the following command to create a new branch on production to push all the dll files from lib/ and bin/

git checkout -b stable_production_dll git add lib/* git add bin/* git commit -m "..." git push

Now, when I used:

git checkout stable_production, the site crashed

I then have to move back to:

git checkout stable_production_dll

What might have happened? No file was removed !

Recent Answers


David te Kloese answered on March 24, 2020 09:41

I assume it's Kentico Portal Engine?

For CB changes you could look into using Kenticos Continuous Integration feature?

You could use that to track most of the DB changes; some info in Kentico docs: docs.kentico.com/.../setting-up-continuous-integration.

In regards to your crashing Site what is the actual error? Did you also Build the application after pulling the new DLLs?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 24, 2020 10:42

Just to add to waht David wrote, this article could be handy too on how to set things up.

0 votesVote for this answer Mark as a Correct answer

Matt Nield answered on March 24, 2020 23:54

The Continuous Integration (CI) module is - as David says - a good route for keeping your development environments up to date, but I wouldn't recomment it for updateing your production server.

What the CI module will do is also give you a mechanism to identify the changes that have been meade between the two commits by running a name only diff on the CIRepository folder: git diff 23b692a 71e0cc9 --name-only CMS/App_Data/CIRepository

You can then use this to fairly quickly build an export from Kentico to update your production server. I've written an article about the process I've used for this on dev.to which may help: Using Kentico CI and Git to help with releases

Regarding your isse with git that you mentioned, I don't think using git to push built assemblies into production is really what you want to be doing here. If you really want ot setup automated deployment, then you're going to want to consider something like Github pipelines or Azure DevOps pipelines to do the build for you. Again - I have an articel about using Azure DevOps with Kentico which may help: Using Kentico 12 MVC with Azure DevOps

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.