AuroraEve@Administrator MINGW64 /e/Documents/Project/AuroraEve's blog/hexo (main) $ git push -u origin main To https://github.com/AuroraEve-GitHub/AuroraEve-s-blog.git ! [rejected] main -> main (fetch first) error: failedtopushsomerefsto 'https://github.com/AuroraEve-GitHub/AuroraEve-s-blog.git' hint: Updateswererejectedbecausetheremotecontainsworkthatyoudo hint: nothavelocally. Thisisusuallycausedbyanotherrepositorypushing hint: tothesameref. Youmaywanttofirstintegratetheremotechanges hint: (e.g., 'gitpull ...') beforepushingagain. hint: Seethe 'Noteaboutfast-forwards' in 'gitpush --help' fordetails.
百度自带的AI帮我解决了这个问题。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
! [rejected] main -> main (fetch first) error: failed to push some refs to ' 报错信息 "! [rejected] main -> main (fetch first) error: failed to push some refs to" 表示你尝试推送到远程仓库时,由于本地和远程仓库的历史提交记录不一致,导致推送被拒绝。
cd "E:\Documents\Project\AuroraEve's blog\hexo" npm install
hexo new post "test" # 会在 source/_posts/ 目录下生成文件 ‘test.md’,打开编辑 hexo generate # 生成静态HTML文件到 /public 文件夹中 hexo server # 本地运行server服务预览,打开 http://localhost:4000 即可预览你的博客
未克隆之前
又遇到报错
1 2 3 4 5 6 7 8 9 10 11 12 13 14
AuroraEve@Administrator MINGW64 /e/Documents/Project/AuroraEve's blog/hexo $ git clone https://github.com/V-Vincen/hexo-theme-livemylife.git Cloning into 'hexo-theme-livemylife'... fatal: unable to access 'https://github.com/V-Vincen/hexo-theme-livemylife.git/': Failed to connect to github.com port 443 after 21073 ms: Timed out AuroraEve@Administrator MINGW64 /e/Documents/Project/AuroraEve's blog/hexo $ ping https://github.com/V-Vincen/hexo-theme-livemylife.git Ping request could not find host https://github.com/V-Vincen/hexo-theme-livemylife.git. Please check the name and try again.
AuroraEve@Administrator MINGW64 /e/Documents/Project/AuroraEve's blog/hexo $ git clone https://github.com/V-Vincen/hexo-theme-livemylife.git Cloning into 'hexo-theme-livemylife'... fatal: unable to access 'https://github.com/V-Vincen/hexo-theme-livemylife.git/': HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
cd "E:\Documents\Project\AuroraEve's blog\hexo" git init git add . git commit -m "my blog first commit" git remote add origin "https://github.com/AuroraEve-GitHub/AuroraEve-s-blog.git" git branch -M main git push -u origin main
//更新项目 cd "E:\Documents\Project\AuroraEve's blog\hexo" git init git add . git commit -m "my blog first commit" git remote add origin "https://github.com/AuroraEve-GitHub/AuroraEve-s-blog.git" git branch -M main git push --force -u origin main
//更新最新版 git add . git commit -m "my blog first commit" git push
Netlify建站
Deploy log
Initializing
遇到报错
1 2 3 4 5 6 7 8 9 10 11 12 13
10:22:13 PM: Failed during stage "preparing repo": Error checking out submodules: fatal: No url found for submodule path "themes/butterfly" in .gitmodules : exit status 128: fatal: No url found for submodule path "themes/butterfly" in .gitmodules : exit status 128 10:22:12 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal) 10:22:12 PM: buildbot version: c832339c7e6d9fd31dd1b952874313ecd87c4644 10:22:12 PM: Building without cache 10:22:12 PM: Starting to prepare the repo for build 10:22:12 PM: No cached dependencies found. Cloning fresh repo 10:22:12 PM: git clone --filter=blob:none https://github.com/AuroraEve-GitHub/AuroraEve-s-blog 10:22:13 PM: Preparing Git Reference refs/heads/main 10:22:13 PM: Error checking out submodules: fatal: No url found for submodule path "themes/butterfly" in .gitmodules : exit status 128 10:22:13 PM: Failing build: Failed to prepare repo
git init git add . git commit -m "my blog first commit" git remote add origin "https://github.com/AuroraEve-GitHub/Butterfly.git" git branch -M main git push -u origin main
遇到报错
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ git add . warning: LF will be replaced by CRLF in package.json. The file will have its original line endings in your working directory warning: adding embedded git repository: themes/butterfly hint: You've added another git repository inside your current repository. hint: Clones of the outer repository will not contain the contents of hint: the embedded repository and will not know how to obtain it. hint: If you meant to add a submodule, use: hint: hint: git submodule add <url> themes/butterfly hint: hint: If you added this path by mistake, you can remove it from the hint: index with: hint: hint: git rm --cached themes/butterfly hint: hint: See "git help submodule" for more information.
采用
git rm –cached themes/butterfly
git rm -f –cached themes/butterfly
遇到报错
1 2 3 4
$ git push -u origin main error: src refspec main does not match any error: failed to push some refs to 'https://github.com/AuroraEve-GitHub/Butterfly.git'
解决方法
1 2 3
git checkout -b main git commit -m "Initial commit" git push -u origin main