neolee / wop-student

零基础编程思维与实践课程《欢迎进入编程世界》学习用书仓库
9 stars 107 forks source link

关于 Git 与 GitHub 入门问题 #3

Closed LLLLLiang closed 3 years ago

LLLLLiang commented 3 years ago

请问根据教材,到了这步,本该可以将README文件移入版本仓库,却显示了以下内容

PS C:\Users\陆\Code\learn-git> git commit hint: Waiting for your editor to close the file... internal/modules/cjs/loader.js:847 throw err; ^

Error: Cannot find module 'C:\Users' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:844:17) at Module._load (internal/modules/cjs/loader.js:737:27) at Function.Module._load (electron/js2c/asar.js:769:28) at Function.Module.runMain (internal/modules/cjs/loader.js:1103:10) at internal/main/run_main_module.js:17:11 { code: 'MODULE_NOT_FOUND', requireStack: [] } error: There was a problem with the editor 'code -w'. Please supply the message using either -m or -F option.

neolee commented 3 years ago

这是一个多年的疑案,之前也有少数同学碰到,而且目前没有找到真实的原因。

本来执行 git commit 的时候 git 应该自动启动 core.editor 设定的编辑器,让你编辑一个提交的说明文字,保存该文字之后继续完成版本提交,但在启动编辑器(code -w)的时候出了一个错,而这个错误为啥会出现目前还不清楚,所以我的建议是暂时用下面的方法绕过:

git commit -m "..."

-m 后面的引号里是提交说明文字。

neolee commented 3 years ago

另:问题应该在 https://github.com/neolee/wop-ecnu-pub/issues 提出,不要在这个仓库提问。

LLLLLiang commented 3 years ago

另:问题应该在 https://github.com/neolee/wop-ecnu-pub/issues 提出,不要在这个仓库提问。

好的,感谢