.gitignore文件是否适用于所有分支? [英] Does a .gitignore file apply to all branches?

查看:112
本文介绍了.gitignore文件是否适用于所有分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Master分支中的.gitignore文件是否适用于其他分支?

Does a .gitignore file in Master branch apply to other branches?

https://help.github中的创建本地.gitignore"部分中.com/en/articles/ignoring-files ,它没有指定您应该位于哪个分支.

In section "Create a local .gitignore" in https://help.github.com/en/articles/ignoring-files, it doesn't specify which branch you should be in.

推荐答案

.gitignore 适用于文件夹 .gitignore 的文件文件在;当前选择哪个分支都没有关系.在 .gitignore 中指定的任何文件都将从Git中排除.

.gitignore applies to files in the folder that the .gitignore file is in; it does not matter which branch you currently have selected. Any files specified in the .gitignore will be excluded from Git.

请注意, .gitignore 中的引用是递归的,因此,如果您在项目的根目录下具有 .gitignore 文件,它将对所有规则应用规则.项目中的文件和文件夹.

Note that the references in .gitignore are recursive, so if you have a .gitignore file at the root level of your project, it will apply the rules to all files and folders within your project.

这篇关于.gitignore文件是否适用于所有分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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