忽略git-svn dcommit中的某些文件 [英] Ignore certain files from git-svn dcommit

查看:135
本文介绍了忽略git-svn dcommit中的某些文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以将文件保留在本地git-svn存储库中,而在git-svn dcommit中将其忽略? 我有一些脚本/批处理文件,我想保留在本地git-svn存储库中,但不希望提交到中央SVN存储库中.

Is there a way to keep a file in local git-svn repo, but ignore it in git-svn dcommit? I have few scripts/batch files which I had like to keep in local git-svn repo but not dcommit to central SVN repo.

有可能吗?

推荐答案

如果文件位于Subversion中的目录中,那么我认为没有办法.因此,我假定它们不在Subversion目录中混合,我假定您可以将这些脚本放在专用目录中.

If the files are in directories that are in Subversion, then I don't think there is a good way. So I will assume they are not mixed in Subversion directories, I will assume you can put these scripts in a dedicated directory.

基于上述假设,我可以想到以下选择:

Given the assumptions above, I can think of the following options:

  1. 将目录标记为已忽略.您可以使用它做任何事情,它永远不会被推回Subversion.您可以自己将其变成一个独立的Git存储库.还是什么都不做.我习惯性地在几乎每个项目中都放置一个tmp目录,以获取我不想成为该项目一部分的临时文件.

  1. Mark the directory ignored. You can do whatever with it, it will never be pushed back to Subversion. You could turn it into an independent Git repository on its own. Or just do nothing. I habitually put a tmp directory in almost every project, for transient files I don't want to be part of the project.

将脚本添加到Subversion中,让您的队友享受他们的好处.

Add the scripts to Subversion and let your teammates enjoy their benefits.

将脚本添加到一个永远不会推回Subversion的专用分支中.但我认为这根本不可行,有一天您可能会无意中误将其推入.

Add the scripts to a dedicated branch that you will never push back to Subversion. But I don't think this would be practical at all, and one day you might mistakenly push it by accident.

PS:您可能会发现

PS: you might find this related post interesting too.

这篇关于忽略git-svn dcommit中的某些文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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