添加到.gitignore的每个文件都被git删除

发布于 2025-01-23 15:32:45 字数 327 浏览 4 评论 0 原文

我最近想开始跟踪我正在参加的证书课程的一些项目文件,因此我获得了Git Desktop应用程序,并将主要项目文件夹链接到GitHub Repo,我打算只跟踪特定的文件夹。

因此,我认为这是正确的方法,我基本上添加了我不想跟踪的所有内容 .gitignore file。
所有这些jupyter笔记本,成千上万的数据图像等等,

一个晚上,一个可以从在线存储库中录制到我本地文件中,git删除了 .gitignore上命名的每个文件。 文件。
除了跟踪的项目文件夹外,每个文件夹都是空的。

有没有办法恢复文件并防止将来发生这种情况?

I recently wanted to start tracking some project files for a certificate course I'm taking, so I got the Git Desktop app and linked my main project folder to my Github repo, where I intended to only track specific folders.

So thinking this was the right way to go, I added basically everything that I didn't want to track to the .gitignore file.
All these Jupyter Notebooks, tens of thousands of data images, etc.

And after one night, and one pull to get the readme from the online repo into my local files, Git deleted every single file that was named on the .gitignore file.
Every folder is empty, except for the tracked project folders.

Is there a way to recover the files, and prevent this from occurring in the future?

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

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

发布评论

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

评论(1

萌逼全场 2025-01-30 15:32:45

那将与 ,我不明白为什么Github桌面会执行它。

检查github桌面的日志以确认这些删除是否来自此应用程序。

但是,关于未经跟踪的删除元素,在文件恢复实用程序之外没有太多,如“ 我可以还原文件(删除a git清洁-fdx )?”,或在您的IDE上。

That would be the same as git clean -X, and I don't see why GitHub Desktop would ever execute that.

Check the logs of GitHub Desktop to confirm if those deletions are coming from this application.

But regarding non-tracked deleted elements, there is not much beside file recovery utility, as detailed in "Can I restore deleted files (undo a git clean -fdx)?", or on your IDE.

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