git从已删除的文件中推动旧提交

发布于 2025-02-03 04:30:06 字数 142 浏览 3 评论 0原文

我一直在尝试推出一个全新的存储库和一个全新的分支机构。当我这样做时,它会从几周前推动文件和提交。这些文件已删除了一段时间。我的工作树绝对没有,我的源控件是空的。我不明白如何使这种行为停止,因为它一直在发生。我在网上搜索事物,我看不到其他有这个问题的人。有任何建议吗???

I keep trying to push a brand new repository and a brand new branch. When I do so, it pushes files and commits from weeks ago. These files were deleted a while ago. There's absolutely nothing in my working tree, my source control is empty. I'm not understanding how I can get this behavior to stop because it keeps happening. I search for things online, and I don't see anyone else that has this problem. Any suggestions???

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稚然 2025-02-10 04:30:06

我知道我的错误。我需要首先做一个git init,然后git add。然后推动 - 设定上游原始主人。然后,这仅将我要github的文件夹/项目推送。

I recognize my error. I need to do a git init first, then git add . then git commit -m "initial commit" then do a git push --set-upstream origin master. This then pushes only the folder/project I want to github.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文