0eix / repo-from-udacity-workspace

Instructions to create a GitHub repo for a Udacity Workspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting up a GitHub repo for a Project in the Udacity Workspace

This document should help you get a remote GitHub repository linked to your Udacity Workspace. Please note that each Workspace will need its own repo.


Instructions

Start in Workspace

  1. Initialize the git repo
git init
  1. Configure your name and email
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
  1. Add and commit existing files:
git add -A
git commit -m "Initial Commit"

Your Workspace terminal should look something like this: Workspace Terminal

Create a access personal token (your unique password):

(source: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)

Update: Support for password authentication was removed on August 13, 2021 So, you will have to generate your own personal access token.

You will have to keep it safe and secret. Each token you generate you can see it once!

(Requirement: You will have to confirm your e-mail account)

  1. In the upper-right corner of any page, click your profile photo, then click Settings.

  2. In the left sidebar, click Developer settings.

  3. In the left sidebar, click Personal access tokens

create new token

  1. Click Generate new token.

create new token

  1. Select the scopes, or permissions, you'd like to grant this token. To use your token to access repositories from the command line, select repo.

  2. Click Generate token.

Go to GitHub.com and log in:

  1. Create a new repository

  2. Do not check the "Initialize this repository with a README" radio button Create a new repository GitHub initialize new repo

  3. On the next page, copy the code in the push an existing repository from the command line section:  
    GitHub setup remote

Go back to Workspace

  1. Paste in the terminal:
git remote add origin https://github.com/your-name/yourrepo.git
git push -u origin master
  1. When prompted enter your GitHub username then enter your newly generated token as your password: Workspace Terminal

Troubleshooting

If there is already a git repo in the Workspace:

  1. Go to the root of the project and delete the repo with this code:
rm -fr .git
  1. Start over at step 1 above

About

Instructions to create a GitHub repo for a Udacity Workspace