Forums

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

I'm trying to fetch all the files on a file directory

Carlos Pardo Pastor
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!
April 30, 2019

I'm trying to fetch all the files on a file directory but I have only find the way to fetch the ones that have the same commit id that the folder not the ones that i could commit later on that have a different commit id with this uri : https://api.bitbucket.org/2.0/repositories/{username}/{reposlug}/src/{node}/{path}

If i have 2 files inside a directory it only fetches me the one that was uploaded at the same time that the original directory was commited not the other 

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2019

Hi @Carlos Pardo Pastor

Our APIs do not provide such a feature. What you could probably do is to use the native GIT features to checkout only the folder you want.

Let's suppose you want to clone just a folder. This would be the sequence of steps:

  1. Clone the repo without checkout
    git clone --no-checkout <YOUR_REPO>
  2. Navigate to the repository folder
    cd <REPO_FOLDER>
  3. Checkout only the content of that folder
    git checkout master -- <RELATIVE_PATH>

You may say that this is fetching the whole repository and you are right. The only thing you can have using the sequence above is a mechanism to checkout a specific path.

I hope that helps.
Please let me know if you need any clarification on this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events