create a new repository on github and push files on the command line

  1. create a new repository on github first, like https://github.com/zhuby1973/play.git
  2. remove old git info on local:
    sudo rm -rf .git
  3. init and push files:
    git init
    git add .
    git commit -m "first commit"
    git remote add origin https://github.com/zhuby1973/play.git
    git push -u origin master
  4. some commands might help to check and verify:
    git remote -v
    git remote rm origin
    git remote set-url origin https://github.com/zhuby1973/play.git

Leave a Reply

Your email address will not be published. Required fields are marked *