How to create a local git project and push into github

2023-11-30
  • Way1: Create a github repository and pull it into local
    1. login Github and create a new and empty repository in github. Copy the repository url and push
    2. Clone the github repository into local: git clone git@github.com:testnx/nuxt-docus-template.git
  • Way2: Create a local git repository and add it into a new empty github
    1. Create a new local repository
      git init
      git add README.md
      git commit -m "first commit"
      git branch -M main
      
    2. Then login Github and create a new and empty repository in github. Copy the repository url and push
      git remote add origin git@github.com:testnx/nuxt-docus-template.git
      git push -u origin main