Thread (22 messages) flat view 22 messages, 9 authors, 2016-08-11

Re: git-show --stat on first commit

From: Shawn Pearce <hidden>
Date: 2016-08-11 19:58:50

Petr Baudis [off-list ref] wrote:
BTW, the other frequent reason why empty commits come up so frequently
is a FAQ "how do I create an unrelated branch in my repository" - their
idea is that they will create a new branch starting with an empty commit
(of course noone would think of anything like that in inferior VCSes
because replacing the checked out trees would took forever; how cool Git
is!).

(The answer is usually "create the branch in a separate repo and then
fetch it to the original one". But it feels a bit kludgy given the
otherwise seamless support for unrelated branches. (Not that I ever was
a big fan of unrelated long-lived branches in general.))
Or just abuse git-symbolic-ref:

	rm .git/index
	git symbolic-ref HEAD refs/heads/unrelated-branch
	git add ...
	git commit ...

see, so simple.  And no need to create an unrelated repository and
pull across to this one...

-- 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help