如何在 Sourcetree 中忽略具有 Git 存储库的文件夹中的所有文件? [英] How do I ignore all files in a folder with a Git repository in Sourcetree?

查看:110
本文介绍了如何在 Sourcetree 中忽略具有 Git 存储库的文件夹中的所有文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由 Sourcetree 管理的 Bitbucket Git 存储库.

我有两个文件夹要提交,但我需要忽略这些文件夹中的所有文件,因为它们只包含临时文件.

我该怎么做?

解决方案

将此添加到 .gitignore:

<预><代码>*!.gitignore

I have a Bitbucket Git repository managed with Sourcetree.

I have two folders that I want to commit, but I need to ignore all the files in these folders, because they contain only temporary files.

How can I do that?

解决方案

Add this to .gitignore:

*
!.gitignore

这篇关于如何在 Sourcetree 中忽略具有 Git 存储库的文件夹中的所有文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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