Duplicate a public repository to my profile?

Hello and sorry for the question, maybe it was already discussed.

I browse many repositories and sometimes I find some interesting models and I would like to clone it into my own personal space. I know that I can download a file and reupload it in my repository but I was wondering if there was an option to just clone/transfer a file from a repository of another user to mine.


1 Like

Hi! You can use this space to duplicate a repo, or do it manually as follows:

  1. git clone the original repo to the local machine
  2. create a new repository on the Hub
  3. git push the repo files to the new repository

Thanks but the idea was that I wanted to duplicate remotely. If I have to download 100 GB and reupload them, it is not convenient to make them transit on my machine locally. I wish there was a way to just do a “copy and paste” kind of thing with the files already on HF, just from a repository of someone else, to mine. Does that option exist at all?

Unfortunately, it doesn’t at the moment.

Hi there! There is another Space, Repo_duplicator - a Hugging Face Space by osanseviero, which duplicates any repo. Under the hood it uses the duplicate endpoint, which you could also use. The format of the endpoint is /api/{repo_type}s/{source_repo}/duplicate and you can use it as shown in app.py · osanseviero/repo_duplicator at main.

1 Like

Thanks, Is there also a way to duplicate a gated repo? Currently it returns an error if the repo is gated even if I have access to it.