Like Github/Download link, after click, you will get a tarball file named with repository name, and inside the file, it also has a root-dir also named by repository name and followed with the version information.
I know I can get this tarball file by git-archive command, but I don't know how to create a root-dir like what Github did.
git archive --format=tar --remote=ssh://git@xx.com:7999/xx_prj/xx_repo.git feature/beta --output="xx-1.3.tar.gz"
What I want is a xx-1.3.tar.gz file, inside it:
xx-1.3/
-- file1
-- file2
-- folder1
-- ..
But now what I get is a file without root-dir:
-- file1
-- file2
-- folder1
-- ..
Please help, thanks.
Try with "--prefix" parameter in your command with the root-dir name what you want.
For more details and example see git-archive --prefix.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.