Reputation: 2776
When I open the Commit Changes Dialog (Ctrl + K) in WebStorm, it selects all changed/added/removed files. I'd like to avoid accidentally committing files. And often I uncheck all files and then check those files that I want to commit.
Is there a way to disable auto-selection of all files by default in the Commit Dialog (I didn't find such option in the settings)?
Upvotes: 6
Views: 1171
Reputation: 30398
Since you said in the comments that you really wanted to not select one particular file by default, changelog.txt
, you can tell Git to ignore changes to that file, and then hopefully WebStorm will not detect the changes either.
There are two similar features for ignoring changes to a file in Git: --assume-unchanged
and --skip-worktree
. See Git - Difference Between 'assume-unchanged' and 'skip-worktree' for the difference. You probably want --skip-worktree
.
You can use it in your case like this:
git update-index --skip-worktree changelog.txt
Now git status
won't include your change to changelog.txt
in its list.
When you're finally ready to actually commit the change, run
git update-index --no-skip-worktree changelog.txt
The comments of http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html suggest some aliases to make the above commands easier to run, although that article only discusses --assume-unchanged
, not --skip-worktree
.
Upvotes: 1