Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to download zipped source code from Bitbucket repository?

Hozen Shi June 1, 2018

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.

 

1 answer

1 accepted

0 votes
Answer accepted
Rambabu Patina _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 1, 2018

Try with "--prefix" parameter in your command with the root-dir name what you want.

For more details and example see git-archive --prefix.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events