Re: Why can't git open empty branches ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hadmut Danisch wrote:

> when creating a new branch in git, it is by default filled with the
> contents of the current branch.
>
> Sometimes a new but empty branch is needed. There are plenty of
> instructions in the web to achieve this with „dirty tricks”, i.e. fiddle
> around with git's internals.

	git init ../unrelated-topic
	cd ../unrelated-topic
	hack away...
	git commit
	cd -
	git fetch ../unrelated-topic master:<new branch>

Or:

	git checkout --orphan <new branch>
	git rm -fr .
	hack away...

Please feel free to contact the authors of the instructions you found
on the web to fix them.

Thanks and hope that helps,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]