Changed git repo location causing go get issue

Hello,

I moved a repo from github to gitlab. In the process the main remote repo went from the default “origin” to a custom name in a private repo so the config file in .git now, in part, looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
[remote "RepoSourceName"]
	url = git@gitlab.com:MyName/MyRepo.git
	fetch = +refs/heads/*:refs/remotes/RepoSourceName/*

However go get is trying to access “origin” which no longer exists instead of RepoSourceName. Does anyone know how to make it access RepoSourceName?

I could probably make the gitlab repo origin to solve this but it seems I should also learn how to make go always use the remote “source” I want instead of always defaulting to origin.

I’m assuming once I have this resolved I can just do a global search and replace in my code from the github URL of my project to the gitlab URL it is now on and it should all work again.

Never mind, I think I know what’s happening here. The code was from my very first project in go and imports are referencing github instead my local packages referencing each other locally.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.