从获取重新定型中排除文件 [英] Excluding files from Getting rebased

查看:42
本文介绍了从获取重新定型中排除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近已从svn切换到git.
与Google及其cracraers彻底磨合失败后,请按以下说明找到我的情况:

I have recently switched from svn to git.
After failed thorough grind up with google and its crawelers, please find my situation as below:

场景

我已经在.gitignore中添加了文件,以使未跟踪的文件git status 静默.

I have added files in .gitignore to makes git status silent about the untracked files.

问题

问题是,每当我rebase我的分支机构时,此文件也会被覆盖,并且我在控制台上看到所有未跟踪的文件.

Problem is that every time i rebase my branch, this file is also getting overwritten and i am seeing all untracked files on console.

要求

是否有任何方法可以执行git ignore <.gitignore_file>,以便在进行任何操作时都无法将其重新设置为基础或覆盖该文件?

Is there any way to do git ignore <.gitignore_file> so that this file is excluded from getting rebased / overwritten on any operation??

推荐答案

如果提交.gitignore文件,我不明白为什么您应该遇到此问题.但是没有什么可以阻止您将.gitignore本身添加到.gitignore

If you commit the .gitignore file, I don't see why you should have this problem. But nothing stops you to add .gitignore itself to .gitignore

关于排除文件的另一种方法,您可以创建文件.git/info/exclude,该文件充当工作目录之外的本地.gitignore.

As for an alternative way to exclude files, you can create a file .git/info/exclude which acts as a local .gitignore outside of the working directory.

这篇关于从获取重新定型中排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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