Saturday, February 24, 2018

github error when commiting to the new repository by the same user

This post is about switching to new repository at the same github account. earlier i had public repository then  i wanted to commit to private repository. thats when i got the following error:

fatal: remote origin already exists

to resolve the above error I did the following:
  1. git remote set-url --add origin https://github.com/username/newrepository.git
  2. git init
  3. git add .
  4. git commit -a -m "Initial commit"
  5. git pull origin master
  6. git push -f origin master ( to push forcefully)
  7. Enter the credentials when prompted for user name and password. 
  8. https://stackoverflow.com/questions/10904339/github-fatal-remote-origin-already-exists 
  9.  

No comments:

Post a Comment