# "Waiting for your editor to close the file..." with Git-Bash

**URL:** <https://forum.codewithmosh.com/t/waiting-for-your-editor-to-close-the-file-with-git-bash/19562>\
**Category:** Git\
**Created:** [April 13, 2023, 9:24pm UTC](https://forum.codewithmosh.com/t/waiting-for-your-editor-to-close-the-file-with-git-bash/19562 "2023-04-13T21:24:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![accoladious](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/accoladious/32/6041_2.png) [@accoladious](https://forum.codewithmosh.com/u/accoladious)\
**Post date:** [April 13, 2023, 9:24pm UTC](https://forum.codewithmosh.com/t/waiting-for-your-editor-to-close-the-file-with-git-bash/19562/1 "2023-04-13T21:24:59Z")

</div>

In Sourctree I opened the terminal and attempted to do  
`git rebase -i origin/main~4 main`

howver it gave me the error  
`hint: Waiting for your editor to close the file... C:\Program Files\Git\git-bash.exe: line 1: C:Program: command not found error: There was a problem with the editor 'C:\Program Files\Git\git-bash.exe'.`

which originally was for VS Code:  
`hint: Waiting for your editor to close the file... "C:\Users\Siegfried\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait: line 1: C:\Users\Siegfried\AppData\Local\Programs\Microsoft VS Code\bin\code: No such file or directory error: There was a problem with the editor '"C:\Users\Siegfried\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait`

, but I don’t have VS Code, so I changed the editor by using  
`git config --global core.editor git-bash`  
`git config --system core.editor "'C:\Program Files\Git\git-bash.exe' -c 'vi'"`.

Also tried using `$ git config --global core.editor "git-bash --wait"` and that doesn’t work.

Created an environment variable too just to see if that would fix it.  
 ![I also created an environment variable](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/6/687ce54e4e63703624de450f0bd0f412c7375835.png)

howeever it’s still giving me the error, very new to Git so sorry. Thank you for replying.
