I have recently taken over a development project that has a Git repository linked to a remote repository hosted on Git Hub.
I have full access to the server that hosts the project and has the Git repository.
I have my own account on Git Hub and want to carry on using the current repository.
What is the best way to update the repository on the server, so it uses my remote repository?
The previous developer is no longer available, so I can’t access their Git Hub account or contact them to request anything. The repository was hosted as private on Git Hub.
I am not 100% confident using Git and just want some advice to avoid any accidental problems I may cause 🙂
Create new repo on GitHub with correct name.
Copy to your clipboard the
https:clone address found when viewing the repo on githubFrom the git command line inside your repo:
The above line disassociates the old repo from your repo (but it could be added back again if you want)
This line above adds a new remote repo to your repo, aliased with the name ‘origin’
The last line will send your commit history and all source code to the new remote. After doing this your code should be visible in github under the new repo.