English 中文(简体)
我怎么能够把档案与一件 g事相匹配?
原标题:How can I match a file to a git commit?
  • 时间:2011-02-02 00:11:21
  •  标签:
  • git

请允许我说,作为网站建设进程的一部分,我向网上查阅的名录复制了一个git项目,并删除该目录。 现在,几天后,在我上下几页之后,在公共网站名录上做了一些承诺,而现在如何使用哪一种简单的方法?

# /var/www (public web dir):
/index.html

# Git repository:
HEAD:/index.html  
HEAD~1:/index.html
HEAD~2:/index.html
.
. <-- /var/www/index.html matches in here somewhere.
.
HEAD~N:/index.html

The only thing I can think to do is write a script to checkout every version of the file in git and check each one, but in my limited experience with git I ve found that there is usually some canonical way to accomplish whatever git task I dream up.

最佳回答

使用标识是一个好的想法。 此外,您可以考虑使用权责制制来制造一种tar球,而不是使用克隆技术,然后删除.。 保存档案,并使用特定目标-commit-tar-id来查找承诺。 为了回答您的实际问题,利用 g-hash-object获得有关档案的布龙线,请见对

问题回答

作为您的建设过程的一部分,管理<代码>git 描述并大体;版本_file,并将该档案存放在你的其他档案中。 这样,你就总是提到档案的内容。

另一种选择是,如果你在工作时希望你能够掌握的胎儿,就是指作为你建设过程的一部分所做的承诺,无论是一个分支还是一个轻重的标签,还是每个建筑都超标。

一种与你所询问的比我所假定的更接近的最后选择是,在(gitattributes)中使用身份过滤器,以取代每个档案中的Id$h。 然而,问题在于,这只会使你知道哪项(多件)含有这一准确版本的档案,而没有(单一)文件。

如果你有一段时间,知道档案与你相匹配,就可以在案卷变更后找到,那么你就不必看一看每版。

如果你不了解与档案相匹配的任何修订,你需要检查所有修订。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签