Learn Git by Building an SQL Reference Object - Nano Not Opening

Hello. I’m having an issue with the git project to build a SQL reference object found below:

https://www.freecodecamp.org/learn/relational-database/learn-git-by-building-an-sql-reference-object/build-an-sql-reference-object

After running “git revert HEAD” in the previous lesson, Nano does not open. I have reset the challenge and re-entered “git revert HEAD” as suggested in the hints but the issue persists.

Instead of Nano opening, a COMMIT_EDITMSG file opens, and the terminal hints to close this file.

COMMIT_EDITMSG:

Revert "feat: add unique reference"

This reverts commit 7f4443692a682f14c68f524c4600a67e2318e908.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch feat/add-column-references
# Changes to be committed:
#	modified:   sql_reference.json
#

When I close COMMIT_EDITMSG in the editor, the terminal displays

[feat/add-column-references f9c6a16] Revert "feat: add unique reference"
 1 file changed, 1 insertion(+), 2 deletions(-)

so it seems that the revert has been successful (?). Pressing ctrl+x doesn’t work anywhere at any point so I can’t progress to the next lesson.

Does anyone know what could be causing this?

It seems I didn’t search the forum thoroughly enough. This issue has already been described and solved in the below post:

https://forum.freecodecamp.org/t/learn-git-by-building-an-sql-reference-object/673804

Hi, can you explain step by step what you did to solve this? I’ve read this solution you mentioned a million times and still don’t understand what to do. Nano simply doesn’t open, so I’m unable to close it to finish this lesson. Thanks!

Hiya:

  • First I reset the lesson (the button at the bottom centre of the lesson).
  • Then I ran the below in the terminal, which I believe should tell git to use nano as the editor for commit messages instead of VSCode.
export GIT_EDITOR=nano
  • Then I run the revert as below in the terminal, which prompted nano to open for me. It also worked for relevant later lessons without having to run the export command again. Though I’d imagine you might have to run the export command again if you opened a new entire Gitpod workspace.
git revert HEAD

Hopefully that will end up working for you?

Thanks for the help! Unfortunately following exactly those steps doesn’t work for me. Nano doesn’t open then, I only get a message “You should have the correct last commit message”. I’ve tried typing git commit -m “feat: add unique reference” or adding Revert “feat: add unique reference” as commit message when clicking those blue Commit buttons, but nothing works. Later I was actually able to open Nano by typing nano filename, and closing it with ctr + x but the lesson was still not passed. I wonder if the problem is caused by hosting this lesson on Gitpod, because I believe that previously it was hosted on Codeally.