<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>PackageRegistry on Last Stand</title><link>https://amatsuzero.github.io/LastStand/tags/packageregistry/</link><description>Recent content in PackageRegistry on Last Stand</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Mon, 12 Oct 2026 10:13:41 +0800</lastBuildDate><atom:link href="https://amatsuzero.github.io/LastStand/tags/packageregistry/index.xml" rel="self" type="application/rss+xml"/><item><title>把 GitHub 依赖迁移到内网 GitLab 的踩坑总结</title><link>https://amatsuzero.github.io/LastStand/posts/ugreen-notes/gitlab-migration-pitfalls/</link><pubDate>Mon, 12 Oct 2026 10:13:41 +0800</pubDate><guid>https://amatsuzero.github.io/LastStand/posts/ugreen-notes/gitlab-migration-pitfalls/</guid><description>&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;公司内网环境极差，外网访问几乎不可达，打包机几乎拉不到 GitHub 上的依赖，所以才把一部分依赖镜像到内网 GitLab，供打包机使用。加上部分仓库很大（如 Alamofire、lottie-ios），迁移过程中集中爆发了一批问题。&lt;/p&gt;
&lt;p&gt;补充两点前置配置经验：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;如果仓库是 Private 的，外部匿名拉取（不携带 token、cookie 等）会失败。需要在 General Settings - Visibility, project features, permissions - Package registry 下打开 &lt;strong&gt;Allow anyone to pull from Package Registry&lt;/strong&gt;；&lt;/li&gt;
&lt;li&gt;往 Pod Spec 仓库推送代码，需要 Maintainer 权限的账号，否则无法 push。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;对于超大仓库，在网络环境差的情况下 &lt;code&gt;git push --mirror&lt;/code&gt; 很容易出现 504 错误，只推我们用到的 tag 即可。&lt;/p&gt;
&lt;h2 id="本次迁移踩坑总结"&gt;本次迁移踩坑总结&lt;/h2&gt;
&lt;h3 id="1-shallow-clone-无法推送-tag"&gt;1. Shallow clone 无法推送 Tag&lt;/h3&gt;
&lt;p&gt;GitLab 报 &lt;code&gt;shallow update not allowed&lt;/code&gt;，需要先 &lt;code&gt;git fetch --unshallow&lt;/code&gt;，再推送标签。&lt;/p&gt;
&lt;h3 id="2-git-lfs-对象缺失"&gt;2. Git LFS 对象缺失&lt;/h3&gt;
&lt;p&gt;GitLab 会拒绝推送并提示 &lt;code&gt;LFS objects are missing&lt;/code&gt;，必须同步并执行 &lt;code&gt;git lfs push --all&lt;/code&gt;。&lt;/p&gt;</description></item></channel></rss>