Introduction
Easiest Method
- In GitHub create a new empty repo, so that it has no files (no README.md). See GitHub's documentation for more details.
- On your local Git client (Git GUI client or command line) execute a git pull from the current git origin host. Confirm that all branches, latest commits, and tags have been pulled.
- Get the Github clone url. See GitHub's documentation for more details.
- Update your local Git repo origin with the new GitHub repo clone url. See GitHub's documentation for more details.
- On your local Git client (git) push your local repo to the (now new!) GitHub origin repo url.
- Login to github.com and check that the new repo has all of the repo branches, latest commits and tags.
Optional: Use GitHub's Import Repo Tool
- Login to git.psu.edu
- On the left side click the icon of your user to display the "User settings"
- On the left side click "Access Tokens"
- Under "Personal Access Tokens" click "Add new token"
- In the "Token name" field enter in "github-import"
- Update the "Expiration date" to at least 1 day ahead
- Under the "Select scopes" section select "read_repository"
- Click the "Create personal access token" button
- Immediately copy and save the new token in the "Your new personal access token" field as you will not be able to access it again!
- Login to GitHub.com with your GitHub.com account that is associated with your Penn State GitHub.com account.
- Once logged in click the "Import repository" Link on the left side
- At the top select the organization you want to import into, ie, "psu-edu"
- Authenticate to Penn State SSO
- In the "Your old repository's clone URL*" field enter the path to your repo, ie: "https://git.psu.edu/teamname/projectname/repo"
- Change the "Owner" to your GitHub User id. Once the repo has been successfully import you will transfer it to the correct org and team.
- In the "Repository name" field enter in the name for the repo as it will exist in GitHub.com.
- Leave the default visibility to "Private"
- Click the "Begin import" button.
- The GitHub importer tool will start the "Preparing your new repository" process...
- The import tool will state something similar to ...
- "Your old project requires credentials for read-only access. We will only temporarily store them for importing. When importing from Azure DevOps, please use a personal access token with read access to the repository being imported."
- In the "Login" field enter in your Penn State access ID.
- In the "Private Access Token" paste in the new personal access token created above.
- The import tool will state something similar to ...
- Click the "Submit" button to start the import process.
- The Tool will attempt to login to git.psu.edu with your read-only personal access token, identify the Git hosting service, optimize the repo, and then once it's successfully imported it will report that the importing process has completed and provide a link for your newly imported repository!
- Soon after the above step you should see an automated email from noreply@github.com with the email subject of "Import to githubuser/reponame is finished!"
Recommended Next Steps
- You should next test and confirm that you are able to clone the repo from github.
- If the repository is just for your use you are done!
- If you wish to make the repository available to others please visit our Penn State GitHub - How to Restrict Access to Repositories article for more information.
- Penn State GitLab users should follow our Migrating from GitLab to GitHub - Decommissioning your GitLab project article for information on archiving and decommissioning projects.
Additional Information
Signing up for Penn State's GitHub Service
Migrating from GitLab to GitHub - Getting Started