Quantcast
Channel: Git push existing repo to a new and different remote repo server? - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by Caro Pérez for Git push existing repo to a new and different remote repo server?

$
0
0

Link a local repository to a different remote repository

1- Delete all connection with the remote repository:Inside the project folder:

  • git rm .git (Remove all data from local repository)
  • git status (I must say that it is not linked to any, something like an error)

2- Link to a new remote repository

  • git init To start a local repository
  • git remote add origin urlrepository.git To link with remote repository
  • git remote -v To confirm that it is linked to the remote repository

3- Add changes to the local repository and push to the remote repository

  • git pull or git pull origin master --allow-unrelated-histories if git history is different in both local and remote repo.
  • git add.
  • git commit -m" Message "
  • git push -u origin master

that's it!


Viewing all articles
Browse latest Browse all 20

Trending Articles