Uploading VS Code Project to GitHub

Introduction

The following provides information on upload a VS Code project to GitHub.

Instructions
  1. Make sure you have git installed on your computer.
  2. Create a GitHub account (in case you don't have one).
  3. Create a GitHub repository/folder
    1. Head to the GitHub home (dashboard).
    2. Look for the + on the menu and select "New Repository" or search for "Create a new repository" to locate the button that will allow you to create it.
    3. Enter a name for your repository.
    4. Select private or public (use private if it is a class project implementation).
    5. Click on the "Create repository" button to create the repository.
    6. After clicking on the button, locate the link that is associated with the repository on the page that appears. For example, a link to a repository DeploymentExample will be similar to:
                      https://github.com/NelsonPaduaPerez/DeploymentExample.git
                      
  4. To initially upload a VS Code folder to the repository
    1. Open the project folder in VS Code.
    2. Open a VS Code terminal and make sure you are in the project folder.
    3. Execute the following commands
      1. git init
      2. git add . (notice there is a period)
        or add any files by using git add followed by the file/directory name (e.g., git add sample.js)
      3. git commit -m "first commit (or any message you want)"
      4. Verify the main development branch name by executing git branch. If the branch is named master, you will see "* master". For GitHub, change it to main by executing git branch -m master main
      5. git remote add origin PUT_HERE_URL_ABOVE_REPRESENTING_GITHUB_REPOSITORY
      6. git push -u origin main
        This will pop up a window for you to log on to GitHub. You can verify you have uploaded your code by visiting the GitHub main page, selecting "Repositories" and the name of your repository.
    4. Notice: A .git folder is created in the VS project folder; you may want to remove it to start again with the setup process. It is hidden, so in Windows you may need to change your settings see it (e.g., View->Show->Hidden Items).
  5. Execute the following commands to upload to GitHub changes you make to your code
    1. git add . (notice there is a period)
      or add any files you edited by using git add followed by the file/directory name.
    2. git commit -m "Your message describing the changes goes here"
    3. git push
  6. At some point, you might need to execute the following command
    git config --global user.email "YOUR_MAIL_ADDRESS"
Web Accessibility