-1

I currently have some private projects in GitHub.

Recently I've set up a server for hosting an indefinite amount of projects, without any cost other than the server itself.

Those projects have multiple branches and commits, and I want to copy all of this to my new server.

Is there a way to download the project with branches, commits, pull requests, etc?

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
LuizLoyola
  • 386
  • 3
  • 20
  • 1
    Possible duplicate of [How to clone all remote branches in Git?](https://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git) – phd Sep 18 '19 at 19:53
  • https://stackoverflow.com/search?q=%5Bgit%5D+clone+all+branches – phd Sep 18 '19 at 19:53
  • 1
    Did you install a source code hosting program on your new server? If so, which is it (name/version)? – kelvin Sep 18 '19 at 20:01
  • @kelvin I've installed the latest git on my Ubuntu server. Up, running and tested – LuizLoyola Sep 18 '19 at 20:56

3 Answers3

1

You can use git clone to do what you want. This will get all of the commits and branches from your GitHub project. It will not include Pull Requests.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
0

Github, like many git host propose you a way to do it : The fork. The point is to start a new git starting as a copy of the first one. Bonus : you will be able to merge what you done on the new git to the source one with a merge request. You will be able to do it by creating a new git repository and set the git you want to fork as a upstream.

The other way is to clone the git you want on your local machine, then push it to a new one. It is closer to a copy because in this case the two git repositories (old one and the copy) will be fully independents. More information here.

redheness
  • 346
  • 1
  • 8
-1

Just found exactly what I wanted:

  1. github.com homepage, logged in
  2. Settings > Account
  3. Export account data

Warning: This downloads all the data of all your repositories you ever collaborated.

This was exactly what I wanted: to download all my repositories and spin them up in another place.

Hope to help somebody in the future trying to migrate their repositories

LuizLoyola
  • 386
  • 3
  • 20