anjanthapaliya / 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

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. Enter your GitHub username and password when prompted: 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