<p>When I try to commit the first revision to my git repository (git commit) from Cygwin, I'm getting an error in gvim which says "Unable to open swap file for "foo\.git\COMMIT_EDITMSG" [New Directory]. I think it might be some sort of permission problem, but I've tried removing the read-only flag from the folder, as well as recursively adjusting the owner (using the windows property tab, not chown under Cygwin) to be the account I'm running under, without any luck. If I change the default editor to notepad, I get "The system cannot find the file specified", even though the file (COMMIT_EDITMSG) does exist and even contains:</p>

<pre><code># Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
# etc...
</code></pre>

<p>How can I troubleshoot this problem further?</p>

Unable to open swap file for "foo\.git\COMMIT_EDITMSG" [New Directory].
Looks like the
```
git commit
```
is passing the file path as a Windows path, not a POSIX path. note the
```
\
```
in the message.
```
gvim
```
is going to try to open `foo.gitCOMMIT_EDITMSG", which doesn't exist.
I don't use
```
git
```
, but I imagine it uses an environment var similar to
```
SVN_EDITOR
```
.  You may need to wrap the editing session with a small script that uses
```
cygpath
```
to change the file path from Windows to Posix separators.
```
```
#!/bin/bash
gvim "$(cygpath --unix "${1}")"
```
```
Caveat Emptor, untested.