Git - 史诗时间浪费==>从git ignore中删除文件时出现意外结果 [英] Git - epic time waster ==> unexpected results when removing files from git ignore

查看:163
本文介绍了Git - 史诗时间浪费==>从git ignore中删除文件时出现意外结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Git的体验并不好(好吧,这很糟糕)。

My experience with Git is not good (ok, it is bad).

这是另一个小时流失的例子。

Here is another example of hours down the drain.

意识到我错过了我本地仓库中的一些文件,而且他们也不在远程仓库中。在stackoverflow上研究这个问题指出了这些文件在gitignore中的可能性。在我的情况下这是正确的。

Come to realize that I am missing some files from my local repo, and they are not in the remote repo either. Researching this issue on stackoverflow points to the possibility of these files being in gitignore. That was correct in my case.

我修改了gitignore,因此不再忽略这些文件。

I modify gitignore so these files are no longer ignored.

我将文件复制回本地环境备份。

I copy the files back into my local environment from a backup.

我打开VS2017并希望看到新添加的文件列为更改。但它们不在那里!

I open VS2017 and expect to see the newly added files listed as Changes. But they are not there!

如何让这些文件可见,以便我可以将它们添加到仓库?

How can I make these files visible so I can add them to the repo?

推荐答案

嗨wavemaster00,

Hi wavemaster00,

你要哪种类型的文件我想忽略?

Which type of files you don't want to ignore?

修改.gitignore文件后,您是否提交了更改并将其推送到服务器?

After you modified .gitignore file, did you commit the changes and push it to the server?

您是否尝试过?右键单击解决方案或文件夹,然后将现有项目添加到您的解决方案中,如下图所示?文件是否可以在更改中列出?

Did you try to right click the solution or a folder then add an existing item to your solution like the picture below? Could the file be listed in the changes?

我试图将.txt添加到.gitignore以忽略txt文件。然后更改将找不到txt文件更改。

I tried to add .txt to .gitignore to ignore txt files. Then the changes will not find txt file changes.

然后我从.gitignore文件中删除.txt。提交更改并将提交推送到TFS服务器。

Then I remove .txt from .gitignore file. Commit the changes and push commit to TFS Server.

之后,我在变化中看到了.txt文件列表:

After that, I saw .txt files list in the changes:

最好的问候 

Best Regards 


这篇关于Git - 史诗时间浪费==>从git ignore中删除文件时出现意外结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆