Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitconfig global remote URL to switch from GitHub to GitLab

Switching from github to gitlab. Imported all my repos.

Now I want to continue pushing my code only to gitlab. How do I make this happen?

I updated my .gitconfig file to use this, but it didn't change anything:

[url "[email protected]/"]
    insteadOf = [email protected]/
like image 489
geochanto Avatar asked Sep 02 '25 04:09

geochanto


1 Answers

Do you have a git repo on GitLab?
Your url = <url to your git repo> should be pointing to an existing git repo. Also [email protected] couldn't possibly be your git repo.
Anyway, just make a repo on GitLab and point that url in your .gitconfig

You can follow this tutorial to make a new project on GitLab. After that copy the url from the browser into the .gitconfig. (add a .git extension to the end)

like image 73
clamentjohn Avatar answered Sep 04 '25 19:09

clamentjohn