-1

I have a website hosted as a Laravel git repo. If I transfer the repo from GitHub to GitLab (or anywhere, for that matter), I'm happy that the GitLab tool works find for this.

But what do I do the server? The current webroot is a checkedout git folder with (many) uncommitted files, such as some pictures uploaded for website pages and the entirity of the /vendor/ folder.

How do I let the server know to re-point the git repo to GitLab?

  • 3
    Possible duplicate of [Git push existing repo to a new and different remote repo server?](https://stackoverflow.com/questions/5181845/git-push-existing-repo-to-a-new-and-different-remote-repo-server) – phd Jun 04 '18 at 15:02
  • Gitlab has a big spike today! :-) – phd Jun 04 '18 at 16:21

2 Answers2

0

As far as I know, you should be able to just:

git remote remove origin
git remote add origin https://yourgitlab.link

Make sure your repos are synced

ryan.wise
  • 469
  • 3
  • 9
-1

The answer was to remove the .git folder and then:

git init
git remote add origin https://gitlab.com/USERNAME/PROJECT.git
git fetch
git reset --mixed origin/master
  • It's not necessary to remove the `.git` folder, that might contain local branches, stashes, and other local information. You can follow [@ryan.wise's answer](https://stackoverflow.com/a/50683103/14660) and change where origin points. – Schwern Jun 06 '18 at 05:02