简体   繁体   English

git:如何忽略所有存在的未跟踪文件?

[英]git: How to ignore all present untracked files?

Is there a handy way to ignore all untracked files and folders in a git repository?有没有一种方便的方法可以忽略 git 存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

Is there a handy way to ignore all untracked files and folders in a git repository?有什么简便的方法可以忽略git存储库中所有未跟踪的文件和文件夹?
(I know about the .gitignore .) (我知道.gitignore 。)

So git status would provide a clean result again.因此git status将再次提供干净的结果。

None of the above answers worked for me.以上答案都不适合我。

In my case, I want a personal config file to be ignored permanently ( git status -uno only works for one use).就我而言,我希望永久忽略个人配置文件( git status -uno仅适用于一次使用)。

I'm part of a team so can't add it to .gitignore as that's checked in.我是团队的一员,因此无法将其添加到.gitignore中,因为它已签入。

Mu solution was to add it to: Mu 解决方案是将其添加到:

.git/info/exclude

which is like your own personal .gitignore file.这就像您自己的个人.gitignore文件。

git reset --hard HEAD
git clean -fxd

will remove any untracked files, and make your local branch up to date with the remote branch.将删除所有未跟踪的文件,并使您的本地分支与远程分支保持同步。 this is good option if you don't want to preserve any local changes you already made.如果您不想保留您已经做出的任何本地更改,这是一个不错的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM