How to publish to GitHub when in school because Sweethaven are stupid and incompetent and cannot fix an issue they have been told about 1000 times by students and staff

Go Home
Go Back

I haven't yet created a GitHub repo

  1. Initialise repository as normal from sidebar menu.
  2. Do some code, type in a commit message, and click Commit.
    • If you get an error saying you need to "Make sure you configure your "user.name" and "user.email" in git.", run git config --global user.name "Your Name" | git config --global user.email "your@email.com" in the terminal and try to commit again. If no terminal is open, click on View in the top left, click on Terminal, and then you will be able to run the command.
  3. After this has completed, click on Publish branch.
  4. You will be prompted to create a repo.
  5. Choose one of the options. This will result in an SSL error. Ignore and close the error window.
  6. Run git branch -M main | git -c http.sslVerify=false push -u origin main in the terminal box.
    • If no terminal is open, click on View in the top left, and click on Terminal.
  7. From now on, each time you want to publish to GitHub, commit as normal from the sidebar, and run git -c http.sslVerify=false push -u origin main in the terminal.

I haven't yet created a GitHub repo

  1. Initialise repository as normal from sidebar menu.
  2. Do some code, type in a commit message, and click Commit.
    • If you get an error saying you need to "Make sure you configure your "user.name" and "user.email" in git.", run git config --global user.name "Your Name" | git config --global user.email "your@email.com" in the terminal and try to commit again. If no terminal is open, click on View in the top left, click on Terminal, and then you will be able to run the command.
  3. Click "Publish Branch". You will be prompted to log into GitHub. Follow the steps to log in, and return to VS Code. If the Login fails, follow the instructions in the bottom right to try to log in. Once logged in, continue.
  4. Run git init | git add . | git -c http.sslVerify=false commit -m "first commit" | git -c http.sslVerify=false branch -M main | git -c http.sslVerify=false remote add origin https://github.com/USERNAME/REPO_NAME.git | git -c http.sslVerify=false push -u origin main in the terminal.
    • If no terminal is open, click on View in the top left, and click on Terminal.
    • If you are get the error that "remote origin already exists", run git remote remove origin, and re-run the above command.
  5. You should be prompted again to log into GitHub. Follow this. You may get some sort of connection error or blank window in your browser. Ignore and close this, and return to VS Code.
  6. You should now have published to your already existing repo.
  7. From now on, each time you want to publish to GitHub, commit as normal from the sidebar, and run git -c http.sslVerify=false push -u origin main in the terminal.