- Ensure you have the repository cloned locally and that it is up to date.
a.git clone <repo-address>
if the repository is not locally available (thecd
into the newly created directory). b. If you had it available and did not need to clone typegit pull
to make sure you have the most recent changes from origin (your current Git host) in your local repository. - Create the destination repository on your GitHub Enterprise instance.
- Change the
origin
URL of your local repository to point to the new GitHub repository.
a.git remote set-url origin <address-to-repo-here>
- Push the repository, with all branches, to GitHub Enterprise.
a.git push origin "refs/remotes/origin/*:refs/heads/*"
- This may prompt you for your username and password.
- If it does and you happen to run across an issue regarding your password due to your LDAP configuration, generate a Personal Access Token and use it as your password in the terminal. This can be found under your profile settings. Remember, once you generate this token it cannot be retrieved, so keep it somewhere safe!
Your repository and all its branches should now be on the Enterprise server.