NFeruch - FreePalestine
NFeruch - FreePalestine

Reputation: 1154

git vscode autostage files on change

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

Answers (2)

user16743355
user16743355

Reputation: 23

Try the Ghost Stage extension for VS Code with Auto Stage.

Upvotes: 1

VonC
VonC

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

Related Questions