Questions tagged [git-archive]

For questions about git-archive, a Git sub-command used to create an archive from part of a Git repository. For example, it can create a tarball of the contents of a particular commit.

git archive is a sub-command used to create an archive, in various formats, from part of a Git repository. For example, it can create a tarball of the contents of a particular commit.

For usage information, see the git archive man page.

52 questions
1
vote
1 answer

how do you download your repo as a file directory

I am trying to download a private git repo. when I do git clone https://:@github..net/Svcs/repo.git it works! But I dont really need all the git history. I just need the repo as a file directory. Hence I was trying to…
Gayatri
  • 453
  • 1
  • 6
  • 18
1
vote
2 answers

`git` - could not able to create `achive` existing repo

I am trying to export my existing git repo with following command. But I end up with errors. any one help me to fix this? my command : PS F:\Nissan-Gulp> git archive --format zip --output F:\convert master fatal: could not create archive file…
user2024080
  • 1
  • 14
  • 56
  • 96
1
vote
1 answer

Specify custom gitattributes file location for git archive

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…
Kevin Burke
  • 61,194
  • 76
  • 188
  • 305
1
vote
1 answer

Can the --remote option in 'git archive' be used on a local repository?

When I try to run git archive on a local repository from a different directory git archive --format=tar.gz --remote=file:///home/user/repos/repodir --prefix=/tmp/test_archive -o archive.tar.gz ref12345 this command fails with the output below. It…
vfclists
  • 19,193
  • 21
  • 73
  • 92
0
votes
0 answers

Is there a way to perform git archive with nodegit api?

I want to perform a git archive using node-git. A feature of git-archive is that it excludes from archive the patterns set with export-ignore inside .gitattributes. What would be a simple way to perform a git-archive operation using nodegit api?
Marinos An
  • 9,481
  • 6
  • 63
  • 96
0
votes
0 answers

Why the `git config tar.tar.xz.command "xz -c"` command can configure a "tar.xz" format for making LZMA-compressed tarfiles when using git-archive?

I encountered this example in Git official documents when learning git-archive. git config tar.tar.xz.command "xz -c" # set this config git archive -o latest.tar.xz HEAD # So you can create an archive that is compressed with LZMA algorithm. But…
hustnzj
  • 525
  • 6
  • 13
0
votes
0 answers

Can I combine git-archive with git-grep?

For a DevOps solution I'm looking for a way to combine git archive with git grep. Is it possible to combine this? e.g.: git archive --remote=url.project.git HEAD: git grep -i searchString $(git branch -r) | tar -x
r0tt
  • 379
  • 3
  • 20
0
votes
1 answer

GIT archive only if files have been changed in git

We are using git archive to deploy scripts on a jump server which than uses rsync to deploy this files on target machines. The git archive cronjob runs every 24h and the files, which are archive from git get a new creation date on the jump server…
r0tt
  • 379
  • 3
  • 20
0
votes
0 answers

Adding other useful info to a git archive filename automagically

Stumbled across this gem: Export all commits into ZIP files or directories whose inital answer met my needs for exporting commits from certain branches (like develop for example) into separate zip files - all done via a simple, yet clever,…
the digitalmouse
  • 223
  • 3
  • 25
0
votes
1 answer

Strange artifacts when using git archive

I'm currently trying to retrieve a single file from a GitLab Repo with the following command (I'm on Windows): git archive --remote=git@git.myrepo.de:path/to/repo.git HEAD dir1/dir2/MyFile.xml > MyFile.xml Essentially it works, but there are some…
TigersEye120
  • 664
  • 1
  • 9
  • 28
0
votes
1 answer

Is git archive output supposed to be bit-repeatable through git versions?

I am using git archive to generate a file which is later hashed to be checked for integrity against a pre-stored hash. However I have not seen anywhere that git archive is intended for bit repeatability, so I fear that any future changes in git…
Álex
  • 1,587
  • 11
  • 17
0
votes
1 answer

git: Select branch when fetching specific file

It is possible to define a specific branch when fetching a file as follows: git archive --remote=git@my.git.server:namespace/projectname.git HEAD:path/to/file somefile.sql | tar -x This will retrive the file from the default project branch. How is…
pkaramol
  • 16,451
  • 43
  • 149
  • 324
0
votes
1 answer

How to create local git repository from git archive?

Is it possible to recreate a git repository locally from the extracted content of a Github repository archive ? To add a little bit of context, my Android app downloads a git repository archive using DownloadManager and a Github repository archive…
J. Doe
  • 85
  • 12
0
votes
1 answer

Fetch minimum path

I have a GitLab repository with a lot of binary garbage (cleanup is sadly not an option). I only need one subdirectory that actually only has text files. And I need to get that folder AFAP. Now I found git archive and thought all my problems are…
abergmeier
  • 13,224
  • 13
  • 64
  • 120
0
votes
1 answer

Exporting Git release branch

I'm using TFS-GIT and I was wondering if its possible to extract everything that's been committed into a release branch to a ZIP. I've looked at an example and it insinuates everything in that branch would be extracted. I'm just looking to extract…
david-l
  • 623
  • 1
  • 9
  • 20