ximu3 / vnite

视觉小说 / Galgame 管理软件
https://vnite.ximu.dev/
286 stars 3 forks source link

[Bug]: Github账号的登录以及仓库的初始化问题 #62

Open noselenar opened 2 days ago

noselenar commented 2 days ago

软件版本

1.5.10

问题描述

1.认证登录问题 在使用GitHub账号授权登录时,web返回授权成功,app返回日志如下日志1.所示。

2.仓库初始化及其后续同步问题 登陆成功后检测到无my-vnite仓库,创建仓库时出现错误,日志如下日志2.所示。 初始化失败后重试同步,日志如下日志3.所示。

问题日志

1.授权登录问题日志

[2024-10-17 01:21:45.878] [info] Git 版本: git version 2.46.0.windows.1 [2024-10-17 01:22:07.628] [error] Github认证错误: TypeError: Cannot read properties of undefined (reading 'username') at file:///D:/applications/vnite/resources/app.asar/out/main/index.mjs:2192:38 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async WebContents. (node:electron/js2c/browser_init:2:77963)

2.仓库初始化问题日志

[2024-10-17 01:26:18.514] [info] Git 版本: git version 2.46.0.windows.1 [2024-10-17 01:26:33.188] [info] Github认证成功: noselenar [2024-10-17 01:26:33.192] [info] 设置已成功更新 [2024-10-17 01:26:33.200] [info] 设置已成功更新 [2024-10-17 01:26:33.215] [info] 本地同步完成,app -> sync [2024-10-17 01:26:41.638] [error] 初始化仓库时出错: Error: fatal: The current branch main has no upstream branch. To push the current branch and set the remote as upstream, use

git push --set-upstream origin main

To have this happen automatically for branches without a tracking upstream, see 'push.autoSetupRemote' in 'git help config'.

at Object.action (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:4463:25)
at PluginStore.exec (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:4502:25)
at file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:1369:43
at new Promise (<anonymous>)
at GitExecutorChain.handleTaskData (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:1367:16)
at GitExecutorChain.<anonymous> (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:1351:44)
at Generator.next (<anonymous>)
at fulfilled (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:45:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

3.初始化后同步问题日志

[2024-10-17 01:34:24.929] [info] 本地同步完成,app -> sync [2024-10-17 01:34:25.025] [error] Github同步失败: Error: fatal: not a git repository (or any of the parent directories): .git

at Object.action (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:4463:25)
at PluginStore.exec (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:4502:25)
at file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:1369:43
at new Promise (<anonymous>)
at GitExecutorChain.handleTaskData (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:1367:16)
at GitExecutorChain.<anonymous> (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:1351:44)
at Generator.next (<anonymous>)
at fulfilled (file:///D:/applications/vnite/resources/app.asar/node_modules/simple-git/dist/esm/index.js:45:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

问题截图

image

noselenar commented 2 days ago

MINGW64 ~/AppData/Roaming/vnite/app $ git config --global --add safe.directory ~/AppData/Roaming/vnite/app

MINGW64 ~/AppData/Roaming/vnite/app $ git init Initialized empty Git repository in ~/AppData/Roaming/vnite/app/.git/

MINGW64 ~/AppData/Roaming/vnite/app (master) $ git remote add origin https://github.com/noselenar/my-vnite.git

MINGW64 ~/AppData/Roaming/vnite/app (master) $ git add . warning: in the working copy of 'config/config.json', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of 'data/categories.json', LF will be replaced by CRLF the next time Git touches it

MINGW64 ~/AppData/Roaming/vnite/app (master) $ git commit -m "initial_commit" [master (root-commit) b34f97a] initial_commit 4 files changed, 44 insertions(+) create mode 100644 config/config.json create mode 100644 data/categories.json create mode 100644 data/data.json create mode 100644 path/paths.json

MINGW64 ~/AppData/Roaming/vnite/app (master) $ git push -u origin main error: src refspec main does not match any error: failed to push some refs to 'https://github.com/noselenar/my-vnite.git'

MINGW64 ~/AppData/Roaming/vnite/app (master) $ git branch

MINGW64 ~/AppData/Roaming/vnite/app (master) $ git push -u origin master Enumerating objects: 8, done. Counting objects: 100% (8/8), done. Delta compression using up to 16 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (8/8), 860 bytes | 430.00 KiB/s, done. Total 8 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) To https://github.com/noselenar/my-vnite.git

手动创建并push到远程仓库之后同步成功,猜测是初始化的代码与当前结构冲突。 image

noselenar commented 2 days ago

另外,向大佬反馈一个月幕的名称问题: 数据库ID 232310092 游戏名称 Baldr Sky Dive2 "Recordare" 其中文名称多一个后引号 image 在月幕官网查证后,确定确有该问题。 image