git-archive

git-archive a subdirectory --

此生再无相见时 提交于 2019-11-27 01:50:25
问题 I'm using git-archive to archive a subdirectory in a git repo, like so: git archive -o ../subarchive.zip HEAD subdir/* However the resulting archive maintains the subdir/ directory structure, i.e. the contents are: subdir/ whatever.js morestuff.js When I actually want whatever.js and morestuff.js at the root of the archive. How do? Thanks. 回答1: You can do that like this: git archive -o ../subarchive.zip HEAD:subdir By the way, an easy way to play with the command and see what it will generate

What does tree-ish mean in Git?

老子叫甜甜 提交于 2019-11-26 23:22:48
I'm very confused about how to use git archive . I have a git repository with folder Foo , Bar and Baz at the top level. I need to export folder Foo in a SVN-ish sort of way for quick test deployment. I learned that I could use git-archive in an SVN-ish export sort of way . But here's the thing, The following works fine: git archive master | tar -x -C ~/destination it results in Foo , Bar , Baz folders in the destination folder. However, the following will error out with fatal not a valid object name : git archive master/foo | tar -x -C ~/destination The Documentation Looking as the synopsis

What does tree-ish mean in Git?

谁都会走 提交于 2019-11-26 09:05:56
问题 I\'m very confused about how to use git archive . I have a git repository with folder Foo , Bar and Baz at the top level. I need to export folder Foo in a SVN-ish sort of way for quick test deployment. I learned that I could use git-archive in an SVN-ish export sort of way. But here\'s the thing, The following works fine: git archive master | tar -x -C ~/destination it results in Foo , Bar , Baz folders in the destination folder. However, the following will error out with fatal not a valid

Do a “git export” (like “svn export”)?

て烟熏妆下的殇ゞ 提交于 2019-11-25 23:58:20
问题 I\'ve been wondering whether there is a good \"git export\" solution that creates a copy of a tree without the .git repository directory. There are at least three methods I know of: git clone followed by removing the .git repository directory. git checkout-index alludes to this functionality but starts with \"Just read the desired tree into the index...\" which I\'m not entirely sure how to do. git-export is a third party script that essentially does a git clone into a temporary location