0

Starting with the branches updated, I'm getting this error. Help will be appreciated.

PS D:\Projects\github\branchexplorer> git revert b578543e3daa17683029bd349103569fe92620e4

Removing originMasterFile02
hint: Waiting for your editor to close the file... 'C:\Users\Mitch\AppData\Local\Programs\Microsoft VS Code\Code.exe' --wait: C:\Users\acct\AppData\Local\Programs\Microsoft VS Code\Code.exe: No such file or directory
error: There was a problem with the editor ''C:\Users\acct\AppData\Local\Programs\Microsoft VS Code\Code.exe' --wait'.
Please supply the message using either -m or -F option.
git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    originMasterFile02

Mitch
  • 641
  • 1
  • 10
  • 13
  • 1
    `C:\Users\acct\AppData\Local\Programs\Microsoft VS Code\Code.exe: No such file or directory` It says no such file or directory. Did you install it there (typically at `C:\Program Files\Microsoft VS Code\Code.exe`)? If not, why is that the directory? If you set the absolute path in your .gitconfig all you need to use is `code -w` – soulshined Jul 20 '20 at 22:08
  • @soulshined Good catch. VSC is not installed there and I don't know where that is coming from. What exactly should I add to .gitconfig and where do I use code -w? Thanks. – Mitch Jul 20 '20 at 22:38
  • 1
    So you have not added anything to a `.gitconfig` file? And you are using the integrated terminal? – soulshined Jul 20 '20 at 22:39
  • @soulshined I've not added anything to .gitconfig and I am using the integrated terminal. Note that I quit VSC and ran the command from Powershell and encountered the same error. HOWEVER, I was able to successfully run git revert from Bash. – Mitch Jul 20 '20 at 22:41
  • hmmm very interesting considering not setting anything in gitconfig. Don't think it's vscode related then. Not sure I am much help at this point. – soulshined Jul 20 '20 at 22:43
  • Oh sorry I missed your initial question @mitch you can see if adding `editor = code -w` to your gitconfig works, perferably global, but can be at repo level. See [here](https://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits) for example – soulshined Jul 20 '20 at 22:47
  • The commits work fine, so I don't think it's an editor issue. In the registry I changed the references to C:\Users\acct\AppData\Local\Programs\Microsoft VS Code\Code.exe to the installed path and restarted. Now I get a different error message: – Mitch Jul 21 '20 at 00:06
  • git revert 4619055 CONFLICT (modify/delete): b.txt deleted in parent of 4619055... Add b.txt and modified in HEAD. Version HEAD of b.txt left in tree. error: could not revert 4619055... Add b.txt hint: after resolving the conflicts, mark the corrected paths hint: with 'git add ' or 'git rm ' hint: and commit the result with 'git commit' @soulshined – Mitch Jul 21 '20 at 00:07
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/218326/discussion-between-soulshined-and-mitch). – soulshined Jul 22 '20 at 00:25

0 Answers0