Simple steps to setup VSCode to work with Github

Jiradett  Kerdsri
3 min readJan 3, 2020

--

  • Pre-requisite: you will need Git installed on your machine. You can follow https://git-scm.com/downloads for the installing instruction.
  • First, create a new repository on Github for storing your files.
  • Copy the URL for your Git repo.
  • From VSCode, add your existing working directory to Workspace.
  • Go to: Terminal > New Terminal
  • Check if you already have Git by:
git status
  • If you see “fatal: Not a git repository (or any of the parent directories): .git”, you will need to initiate Git first.
git init
  • If you check your status you should see the report of your files (notice Git icon on the left menu of VSCode).
  • Now you can add your Git repo (using URL copied from your Github repository)
git remote add origin your_URL.git
  • Check your remote destination by:
git remote -v
  • You can commit change on your files using Git menu on the left of VSCode screen.
  • Write Message on the box and press ✔️ icon to commit the change.
  • Now, you can upload your files to repo by:
git push -u origin master
  • If everything is done correctly, you should see your files on Github 😁
  • Now you can enjoy coding on VSCode syncing with Github.

PS: A good cheat sheet for Git command can be found at https://education.github.com/git-cheat-sheet-education.pdf

--

--

No responses yet