gpt4 book ai didi

git - .git/branches 文件夹的用途是什么?

转载 作者:IT王子 更新时间:2023-10-29 01:15:38 26 4
gpt4 key购买 nike

我一直认为 .git/branches 目录是用于遗留目的,并且 git 过去使用该目录,但现在使用 .git/refs 目录反而。这是真的?如果没有,那么该目录的用途是什么,因为我从未见过它被使用或引用过。

编辑

我使用的是 git 版本 1.7.3.4。

最佳答案

有用的 gitrepository-layout documentation 中描述了 .git/branches 现在“略微弃用”的使用:

branches: A slightly deprecated way to store shorthands to be used to specify URL to git fetch, git pull and git push commands is to store a file in branches/<name> and give name to these commands in place of repository argument.

在上面的评论中,问题是为什么有些人有这个目录而有些人没有。似乎a commit was introduced in 2009默认情况下,这会阻止 git 创建 .git/branches 目录。然而,最近这种变化was reverted (即意味着 .git/branches git init 等上创建),Junio C. Hamano 给出了以下理由:

There is not enough justification for doing this. We do not update things in .git/branches and .git/remotes anymore, but still do read information from there and will keep doing so.

Besides, this breaks quite a lot of tests in t55?? series.

关于git - .git/branches 文件夹的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10398225/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com