[prev in list] [next in list] [prev in thread] [next in thread]
List: git
Subject: Re: How to put tree into index
From: Johannes Sixt <j.sixt () viscovery ! net>
Date: 2013-11-20 12:41:10
Message-ID: 528CADE6.3020604 () viscovery ! net
[Download RAW message or body]
Am 11/20/2013 12:47, schrieb Alexander GQ Gerasiov:
> 1. I have repository with tree like this:
>
> dir1/
> file1
> file2
> file3
>
> dir2/
> subdir1/
> some files
>
>
> 2. Current branch is B.
>
> 3. I want to get dir1 from branch A, and save it's content on current
> branch (B) as dir2/subdir1
> So my question is
> How to put into index tree-object with known sha1 and given name?
git rm -r --cached dir2/subdir1 &&
git read-tree --prefix=dir2/subdir1/ A:dir1
Note the trailing slash.
> PS I was able to do what I need when copied files, not tree-itself.
> Just add -r to git ls-tree, and put into index blobs/files, not tree.
> But I'm interested: is it possible to put tree-object into index?
No, because the index does not store trees, only blobs.
-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic