将没有历史记录的 Xcode 项目添加到 GitHub
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论