且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

裸仓库为什么有HEAD

更新时间:2023-02-14 23:24:49

Can you please name a case where HEAD is used in a bare repository?

See "t/t1430-bad-ref-name.sh"

You can do a soft reset in a bare repo, which means you can move HEAD (current commit) around, which is one way to change the default branch.

That means that when you clone a bare repo, the default branch checked out in the non-bare clone will be the one referenced by the bare repo HEAD.