So I have an azure devops repo and pipeline that copys the repo to my server when changes are pushed. However there are times when some of our developers may make a direct edit to the production server. Is there a way for me to have the azure agent that is installed on the server watch the files for any additions/changes and if/when this happens it pushes the files to the repo?

I have tried to find a solution for this but have been unsuccessful.


First, I'd highly recommend not doing this - a better approach would be to have a single source of truth (that is your repo). Force developers to commit & push changes and let the pipeline do the rest. If it's not in repo, it didn't happen.

If you absolutely have to, then I'd go with "brute-force" way - have a pipeline that triggers periodically (every couple of hours or so) and does a diff of server files against repo files. If something changed, send a threat email to the developer who did this sync back to repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.