将没有历史记录的 Xcode 项目添加到 GitHub

发布于 2025-01-10 04:19:18 字数 504 浏览 0 评论 0原文

我在 Xcode 中有一个 Swift 项目,最初在其中设置了本地源代码控制。

因此,当我转到源代码控制导航器时,我会看到过去几年的提交。

我现在希望将此源的最新版本保存到 GitHub。我设置了一个Remote,但它将所有历史提交推送到 GitHub,这是我不想要的,所以我删除了该存储库。另外,我希望新添加的 (project)/Git/.gitignore 文件得到尊重。

最好能够选择在本地回顾过去几年的更改,并仅远程共享当前版本。但如果我不需要这个,那么我想到的一个想法就是从这个项目中完全删除源代码控制(一种方法< /a>),然后重新建立项目的源代码控制并将其连接到远程。我曾希望有一种“正确的方法”可以在本地保存历史记录,同时仅远程共享当前版本。

我应该采取哪些步骤来使 GitHub 上的版本没有历史记录并遵循新的忽略文件?

I have a Swift project in Xcode where local source control was originally set up.

So this results, when I go to the Source Control Navigator, I see commits for the last few years.

I now wish to save just the latest version of this source to GitHub. I set up a Remote but it pushed all of the historical commits to GitHub, which I did not want, so I deleted that repo. Also, I would prefer that the newly added (project)/Git/.gitignore file is honored.

It would be preferable to have the option of looking back at the changes from the last few years locally, and only share the current version remotely. But if I didn't need that, then one idea that came to me would be to completely remove source control from this project (one method), then re-establish source control for the project and connect it to the remote. I had hoped that there was a "right way" to preserve history locally while sharing only the current version remotely.

What steps should I take to make it so the version on GitHub has no history and honors the new ignore file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文