git 提交文件夹到github 报错 [remote rejected] main

本文最后更新于:2023年3月23日 上午

问题描述

git push的时候报错

1
2
3
4
5
6
7
8
9
10
11
12
13
$ git push -u origin main
Enumerating objects: 490, done.
Counting objects: 100% (490/490), done.
Delta compression using up to 12 threads
Compressing objects: 100% (470/470), done.
Writing objects: 100% (490/490), 1.23 MiB | 1.35 MiB/s, done.
Total 490 (delta 48), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (48/48), done.
remote: fatal error in commit_refs
To https://github.com/KnightKilito/GoldenArch.git
! [remote rejected] main -> main (failure)
error: failed to push some refs to 'https://github.com/KnightKilito/GoldenArch.git'

问题

解决办法

重新git push一下就行

输入:

1
$ git push -u origin main

效果:

重新push即可

1
2
3
4
5
6
7
8
9
10
11
$ git push -u origin main
Enumerating objects: 490, done.
Counting objects: 100% (490/490), done.
Delta compression using up to 12 threads
Compressing objects: 100% (470/470), done.
Writing objects: 100% (490/490), 1.23 MiB | 1.45 MiB/s, done.
Total 490 (delta 48), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (48/48), done.
To https://github.com/KnightKilito/GoldenArch.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.

git 提交文件夹到github 报错 [remote rejected] main
https://moechun.fun/2022/07/19/git 提交文件夹到github 报错 [remote rejected] main main (failure) error failed to push some refs to/
作者
Knight Kilito
发布于
2022年7月19日
更新于
2023年3月23日
许可协议