Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to search and copy files from 100 Repos into ONE Repo? (by searching keywords in filename)

DI WANG April 13, 2023

There are 100+ Repos, want to scan, copy, and save those files (with keywords in filenames),  into ONE repo, please help!

1 answer

1 accepted

1 vote
Answer accepted
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2023

I think this question is not particularly specific to Bitbucket, but a general batch processing problem that includes working with a VCS a bit.

I would develop an external script (probably in Python) that would do something like this:

  1. Connect to the Bitbucket REST API and get all repositories
  2. Iterate over the repos and clone those one by one to the local filesystem
  3. (now you have a local copy of everything that you can process)
  4. Create a new empty repository "Result" through the Bitbucket REST API
  5. Also clone "Result" to the local filesystem
  6. Process the local files
    1. Match the keywords to the filename
    2. If it matches, copy the file to the result
  7. (now you have the result in the "result" local clone)
  8. "git push" the result

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events