Adapt gitdeploysetup script. It's working for the most part