alexxjk
alexxjk

Reputation: 1701

What is a best strategy to clone Git repository

I'm apologizing if my question has been already answered, I wasn't able to find a best solution for my particular case.

We have a Git repository with a few branches that can't be merged into origin branch. And now we need to clone this repository with all branches so we can go a different way.

The repository in hosted on GitLab. I believe that a best approach would be to simply copy the repository and upload it again in our own space.

But unfortunately, due to our bureaucracy it's a time-taking process. Alternatively we can simply fork the repository and I wonder if it will give us some troubles in future?

Thank you!

Upvotes: 1

Views: 544

Answers (2)

Nicolas Pepinster
Nicolas Pepinster

Reputation: 6221

In Gitlab UI, you can create a new project by specifying a git repo url.

enter image description here

This will import the content of the referenced repository. Be aware that the import will time out after 180 minutes (Gitlab advices the git clone/push combination describe by @dunajski for big repo.

Upvotes: 0

dunajski
dunajski

Reputation: 389

In your specified situation I'll do.

  1. Clone repo git clone [url] to new destination.
  2. Then check remotes git remotes -v.
  3. Set remote url to new destination git remote set-url {remote_name} url.
  4. Try to push something by git push remote_name branch_name

Upvotes: 3

Related Questions