Sos
Sos

Reputation: 1949

Moving Github Enterprise to GitHub

I have a couple of private repositories where I am the only contributor under Github Enterprise through my university. I am wondering, how can I add my GitHub open (personal) account as a contributor, or alternatively move the repositories from the Enterprise to the Github Open account?

I am aware of where to go to add collaborators, but I cannot find my Github Open username when I search it in the Enterprise github.

Thanks in advance

Upvotes: 1

Views: 1628

Answers (2)

VerzatileDev
VerzatileDev

Reputation: 11

Anyone reading into transferring "GitHub Enterprise" repository in 2022, there has been an update in GitHub which enables you to transfer the project only using GitHub pages (Enterprise & Personal) and avoids using CMD (command prompt).

Doing this step will automatically cast contributors (If their account is linked to a personal one as well as the Enterprise account), issues & history of the project to your new repository.

Steps to Complete it:

  1. Go to your "Personal GitHub account"

  2. Make a new repository -> select a name that you wish the project to be called.

  3. Do not add any " Git ignore / read.me files into your project (It has to be empty!) & Select it to be a public repository.

  4. On the empty project page, scroll down to " Import Code " click on it.

  5. Opens up with a new page, where you are required to enter your "GitHub Enterprise link https://enterprise.name.ac.uk/MyProject.git <-- This will be different for you!

  6. Press " Begin Import "

  7. Which will then prompt you with a log in for (GitHub Enterprise account), which you are required to enter correctly for it to work, once entered it should start importing

  8. You are then prompted with a panel asking which of the projects you would like to import attached to your Enterprise URL, select one of them and click " Submit ".

  9. Once the transfer has finished you will get an e-mail that states that the import has been finished which provides you with a link to your new repository page!

Enjoy!

Further Read into Official Github Importing Steps.

Upvotes: 1

Adil B
Adil B

Reputation: 16836

You can accomplish this by:

  1. Creating a new repo under your GitHub personal account,
  2. Then, using the command line to set your new repo's URL as a remote to your local copy of your Enterprise repo,
  3. Finally, force pushing all contents to the new public repo.

Once you've created your new personal repo, grab its URL like so:

get github repository url

Then, using the command line, cd into your local copy of your Enterprise repo and ensure it's up-to-date via git checkout master and git pull origin master (or whatever your desired master branch is named).

Run this command to add your new public GitHub repo as a remote repository:

git remote add public https://github.com/user/repo.git

Finally, do a force push to your public GitHub repo to push all of your Enterprise repo's contents to it:

git push -f public

Upvotes: 1

Related Questions