Re: Branches & directories
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 17, 2011, 19:14 UTC
- Message-ID
- <7vvctvdf5r.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CABNdCrCbSqup1=D2eEbGDhw3JzZGYHWLVqZFsB6GDO4Vk7HRxg@mail.gmail.com>
Evan Shelhamer <shelhamer@imaginarynumber.net> writes:
Show 9 quoted lines
> (in repo on your branch) > mkdir test_dir > touch test_dir/.gitkeep > touch test_file > git add * > git commit -m "test commit (with directory)" > > Will commit the directory as expected in your branch, and when you go > to checkout another branch it will not exist.
... unless you have untracked files in test_dir/, that is.
If the branch you are switching to does not have anything at test_dir, you will not lose the untracked file because git does not remove test_dir/ nor its untracked contents.
Depending on what you have at the path "test_dir" in the branch you are switching to, the actual rules are a bit more subtle than that, though.