Reputation: 1154
I have various log files that I'm tracking through git, and because they're log files, they are constantly changing with every commit.
I would like for these files to be automatically staged (git add ...
) when they are changed, to save me some time. Is this possible?
Upvotes: 2
Views: 1472
Reputation: 1328072
Beside an alias, a shell script like gitwatch
could help, provided you have a recent enough WSL (if you are on Windows, to support systemd
/systemctl
)
On Mac:
systemctl --user --now enable gitwatch@$(systemd-escape "'-r url/to/repository' /path/to/log/folder").service
That being said, this is not considered a best practice, and could lead to "too many commits" cluttering your Gitrepo history.
Upvotes: 1