我提取了一个存储库并清理了不相关的部分。当地一切都很完美。我想保留以前的回购历史记录。
然后我创建了另一个存储库,一个干净的存储库。但推送失败是由于pre-receive hook declined
我很确定我的存储库中没有此类内容:)
我尝试了几个命令,例如 --force-with-lease,但没有成功。
这里可能有什么问题,我从中提取的先前存储库是否有问题。
git push --verbose --set-upstream origin Last-backup:pushed-from-different-repo --force-with-lease
Pushing to git@gitlab.localhost:tkcn/history-recovery.git
Enter passphrase for key '---/.ssh/id_rsa':
Counting objects: 415402, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (129955/129955), done.
Writing objects: 100% (415402/415402), 78.71 MiB | 271.00 KiB/s, done.
Total 415402 (delta 229277), reused 411834 (delta 226634)
remote: Resolving deltas: 100% (229277/229277), done.
remote: Checking connectivity: 415402, done.
remote: GitLab: Push operation timed out
remote:
remote: Timing information for debugging purposes:
remote: Running checks for ref: pushed-from-different-repo
remote: Checking if you are allowed to push... (5.83ms)
remote: Checking if default branch is being deleted... (0.12ms)
remote: Scanning repository for blobs stored in LFS and verifying their files have been uploaded to GitLab... (25.63ms)
remote: Checking if branch follows the naming patterns defined by the project... (3.38ms)
remote: Validating diff contents... (cancelled after 41262.16ms)
To gitlab.localhost:tkcn/history-recovery.git
! [remote rejected] Last-backup -> pushed-from-different-repo (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.localhost:tkcn/history-recovery.git'
Run Code Online (Sandbox Code Playgroud)
git subtree split 和 git filter-branch --prune-empty 不起作用,因为文件夹在历史记录中移动了几次。
stackoverflow 上最合适的解决方案看起来像/sf/answers/1033505791/ 但是我无法在我的 Windows 计算机上运行它。
预接收挂钩在远程 git 服务器(gitlab、github 或任何 git 服务器)上执行,而不是在克隆 git 存储库的工作站/服务器上执行(不要与预提交挂钩混淆,预提交挂钩脚本是在提交克隆的存储库之前执行,并且位于 YOUR_REPO/.git/hooks/ 中)
基本上,您尝试推送项目的 git 远程服务器(github 语言的存储库)启用了预提交挂钩,该挂钩通常由组的所有者/管理员有意设置(相当于 GitHub 中的组织)以确保任何推送事件都遵循一定的质量检查。
编辑:
如果您注意 git Push 的推送错误的详细程度,您可以看到已经通过了几个检查步骤,例如分支名称等,但它失败了,因为验证差异部分花费的时间比超时长。
remote: Validating diff contents... (cancelled after 41262.16ms)
Run Code Online (Sandbox Code Playgroud)
您还可以联系您的项目/存储库所在的组(组织)的管理员,以获取有关预接收挂钩期望的质量检查的更多详细信息
| 归档时间: |
|
| 查看次数: |
30499 次 |
| 最近记录: |