Re: Feature request: Allow extracting revisions into directories
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Feb 10, 2013, 04:06 UTC
- Message-ID
- <20130210040621.GA8584@elie.Belkin>
- In-Reply-To
- <1360468628.6610.5.camel@t520>
Hi Robert,
Robert Clausecker wrote:
Show 6 quoted lines
> There are two things git archive is missing that are needed in my use > case: > > First, git archive in combination with tar won't remove unneeded files. > You have to run rm -rf before manually which brings me to the next > point; git archive can't really make incremental updates.
My advice is to keep a separate index file for your exported files. Like this:
GIT_DIR=$(readlink -f $(git rev-parse --git-dir)) GIT_INDEX_FILE=$GIT_DIR/index-for-deployment export GIT_DIR GIT_INDEX_FILE
cd $dest git read-tree -m -u <tree>
Hope that helps, Jonathan