如何防止忽略的文件被删除? [英] How to prevent ignored files from being removed?

查看:73
本文介绍了如何防止忽略的文件被删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的版本控制了几个月前在我的默认分支上的一个项目设置文件夹,然后随着时间的推移,创建了许多默认分支.现在,我决定不希望控制项目设置文件夹的版本,因为它在分支之间切换时会产生很多问题.

I version controlled a project settings folder a couple months back on my default branch, and then over time created many branches off default. Now I've decided that I'd rather not have the project settings folder version controlled as it creates a lot of problems when switching between branches.

因此,我已经hg forget创建了该项目设置文件夹,该文件夹可让我将文件保留在本地计算机上,但删除这些文件时会比较麻烦.但是,当从仍具有此文件夹版本的旧分支之一切换回默认分支时,实际上会从本地计算机上删除文件,这很糟糕.

So I've hg forget'd this project settings folder which lets me keep the files on my local machine but removes them mercurial. However, when switching from one of the old branches which still have this folder versioned back to the default branch it actually removes the files from the local machine, which is bad.

如何预防?

默认情况下,该文件夹也位于.hgignore中.

The folder is also in .hgignore on default now.

推荐答案

这不可能.

但是通常的做法是在签出源代码之后立即将config.ini.dist保留在存储库中,并通过某些构建系统构建特定于环境的配置.

But the common practice is to keep config.ini.dist in your repository and build environment-specific config by some build-system right after you check source code out.

这篇关于如何防止忽略的文件被删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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