Given
- An unversioned directory tree with files.
- An empty git repository.
What's a robust way to repeatedly import the directory tree into the git repo?
Goals:
- No commit if no changes in directory tree.
- Any file or directory additions/modifications/deletions are committed and pushed.
Sample use case:
- Snapshot unversioned data, could be reports, configuration exports etc.
Assumption:
- Only this process makes changes to the repo, so no merge conflicts possible.
First attempt, based on Recursively add the entire folder to a repository:
# Here some process makes changes to the directory tree
git add --all
git commit -m "<commit message>"
git push
Improvements/remarks are welcome.