Publishing a new repository to GitHub from VS code

Of course you could use the GutHub desktop client, but you feel cooler after doing it from the terminal.

First find the terminal in Visual Studio Code

  1. Create your new repository on GitHub. Do not adde README, license or gitignore for now. Note the “remote repository URL”, which you will need in step 7 instead of **URL**.
  2. Open terminal
  3. Initialize a new Git repository: git init
  4. Stage your files before first commit: git add.
  5. Commit the files: git commit -m “Project started”
  6. Add remote repository: git remote add origin **URL**
  7. Verify the remote repository: git remote -v
  8. Push the first changes: git push -u origin master

Read more at Github Help.

Share if you like!

Read more?

Leave a Reply