문제

How do I Make GIT auto-commit every file change (centOS)

Is it possible to everytime my webserver has an update made to it, that it automatically updates the bitbucket repository for it.

I've got a developer who is constantly updating the server source code, but he's not making repo commits, is their a way to make the server auto commit when he updates the code on the server so I have a history of what changes have been taking place.

NOTE: This is a development server so security isn't a high priority but it would be nice.

도움이 되었습니까?

해결책

The solutions in the comments are preferable. But if you are really desperate, you could write a cronjob to automatically commit all modified files in a directory every minute, hour or day.

Just write a simple script that commits and pushes from the directories you care about -

#!/bin/bash

cd /path/to/repo/
git commit -a -m "Auto-Commit"
git push

Then add the script to your crontab, CentOS Instructions here. Have it run however often you like.

This will only commit files that have already been added to the repository.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top