Forums

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

Bitbucket Cloud cloning Repositories via REST API

Lars Schweikardt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 10, 2020

Hi there,

Iam curious if its possible to clone a repository via the REST API as I haven't found anything yet. If thats not possible, I would like to ask if its possible to retrieve just the .git folder from a repository.

 

Many thanks in advance!

 

Regards Lars 

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2020

Hello @Lars Schweikardt,

Welcome to the Community.

I'm not entirely sure what did you mean by REST API here. You can clone a repository over HTTPS using same credentials as Bitbucket REST API (even using OAuth token, for instance), but it won't actually be REST, as it is defined.

The .git directory is the entire repository (it contains all objects, refs, etc.), so it is exactly the same as cloning a repo. You probably meant clone bare repo without checking out working directory? This is a client-side operation, i.e. Git first fetches the whole repo, then it can create a working directory for you. See Git clone documentation for details.

If you describe what you're actually trying to achieve, I might come up with other hints.

Hope this helps. Let me know if you have any questions. 

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events