HP Peng
HP Peng

Reputation: 325

Git commit is creating unnecessary file. How to stop it?

When I execute git commit in Git Bash, it always pops up a message:

\Documents\revision_control\reflection\ -w does not exists. Create it?

error popup

What is wrong with my Git Bash? Is it due to some configuration that was accidentally changed? I'm sure there's nothing called -w in the staging area. See output of git status below:

On branch master
Initial commit
Changes to be committed:
(use "git rm --cached ..." to unstage)

    new file:   test.txt

Upvotes: 1

Views: 91

Answers (1)

HP Peng
HP Peng

Reputation: 325

The problem is in the .gitconfig file in my home directory.

It has the following line:

[core]
    editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -n -w

removing the -w solves this issue

Upvotes: 2

Related Questions