Implemented dynamic detection of remote repository change between deployments

This is a fix for Issue #809