git-archive

Export all commits into ZIP files or directories

旧街凉风 提交于 2021-01-28 05:52:19
问题 How is it possible to export all commits into ZIP files (containing all files , not only patch/diff): myproject-commit1-67d91ab.zip myproject-commit2-9283acd.zip myproject-commit3-c57daa6.zip ... or into directories: myproject-commit1-67d91ab/ myproject-commit2-9283acd/ myproject-commit3-c57daa6/ ? I was thinking about commands like: git archive --format zip --output myproject-commit3.zip c57daa6 from How do I export a specific commit with git-archive?, but how to get all commits ? Notes: the

git archive with unstaged changes

可紊 提交于 2019-12-23 09:59:39
问题 I'm building my own rpm's. Usually I use git archive to get a tarball from the commit or tag I'm interested in (suppose I have put a tag 1.0): git archive --format=tgz --prefix=product-1.0 1.0 > product-1.0.tgz suppose now I am doing some local developments that I haven't committed yet and I want to get an archive; is there any way to obtain this without having to commit? edit I could just use something like this: tar cf product-1.0.tgz --exclude=.git but that will include all binaries and

Specify custom gitattributes file location for git archive

允我心安 提交于 2019-12-14 02:35:06
问题 I'd like to expose git archive , but have a way for users to ask for some files or globs to be excluded, so the resulting archive file is not very big. Normally you'd write the file/glob list to .gitattributes and then run git archive . But this means only one person can ask for an archive per on-disk repository, since they have to write their ignore-export list to .gitattributes , then get the archive, before yielding to someone else. Also this means that whatever settings you had in there

How to ignore files/directories in “git archive” and only create an archive of a subdirectory?

两盒软妹~` 提交于 2019-12-07 18:28:34
问题 TL;DR: The git archive command seems to only either archive a single subdirectory or adhere to .gitattributes and exclude files/directories from the resulting ZIP, but cannot do both. Say I have this directory structure in my git archive (simplified for reasability): . ├── assets ├── build ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE.md ├── README.md ├── scripts ├── src │ ├── background │ ├── common │ ├── icons │ ├── _locales │ ├── manifest.json │ ├── options │ ├── popup │ └── tests └──

How to ignore files/directories in “git archive” and only create an archive of a subdirectory?

…衆ロ難τιáo~ 提交于 2019-12-06 08:05:59
TL;DR: The git archive command seems to only either archive a single subdirectory or adhere to .gitattributes and exclude files/directories from the resulting ZIP, but cannot do both. Say I have this directory structure in my git archive (simplified for reasability): . ├── assets ├── build ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE.md ├── README.md ├── scripts ├── src │ ├── background │ ├── common │ ├── icons │ ├── _locales │ ├── manifest.json │ ├── options │ ├── popup │ └── tests └── tests -> src/tests Now I want to get an ZIP (or tar) archive with the following content: content of src

git archive fatal: Operation not supported by protocol

北战南征 提交于 2019-12-01 02:09:36
I'm trying to checkout part of remote git repository. As recommended here , with help of command git archive --format=zip --remote=http://path_to_repository But I'm getting error message: fatal: Operation not supported by protocol. Unexpected end of command stream Git is not supporting this operation with http protocol? Thats a problem of hosting environment or git itself? Any directions would help, thanks. J-16 SDiZ git archive can work with a server with git protocol support (i.e. git server, smart-http and ssh server). In your case, either your git is too old, or the server is dumb http

Git: get specific revision from remote server

时光怂恿深爱的人放手 提交于 2019-11-30 23:51:18
I'm setting up a test-architecture. In this system a VM has to test a specific revision of the code. The VM is completely clean, and does not have a local (updatable) version of the repo. The code is being hosted on an on-site git server, over ssh with a user named git. I have full control over both machines. The easy solution is: git clone --no-checkout git@gitserver:reponame.git git checkout 8e8fdea8f8367f4a179d2faddbaadba495d6bc12 This works, but does too much: It transfers the full history over the network, something I want to avoid if at all possible. It seems to me from the documentation

Git: get specific revision from remote server

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 18:04:31
问题 I'm setting up a test-architecture. In this system a VM has to test a specific revision of the code. The VM is completely clean, and does not have a local (updatable) version of the repo. The code is being hosted on an on-site git server, over ssh with a user named git. I have full control over both machines. The easy solution is: git clone --no-checkout git@gitserver:reponame.git git checkout 8e8fdea8f8367f4a179d2faddbaadba495d6bc12 This works, but does too much: It transfers the full

git archive fatal: Operation not supported by protocol

风格不统一 提交于 2019-11-30 00:16:39
问题 I'm trying to checkout part of remote git repository. As recommended here, with help of command git archive --format=zip --remote=http://path_to_repository But I'm getting error message: fatal: Operation not supported by protocol. Unexpected end of command stream Git is not supporting this operation with http protocol? Thats a problem of hosting environment or git itself? Any directions would help, thanks. 回答1: git archive can work with a server with git protocol support (i.e. git server,

git-archive a subdirectory --

杀马特。学长 韩版系。学妹 提交于 2019-11-28 08:19:59
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. 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 is if you use it in this form: git archive --format=tar HEAD:subdir | tar t git archive --format=tar HEAD