How to add a project to Gibhub


  • Check git is installed on your machine: git --version
  • Download the latest git: git clone

Create a new repository(repo) in GitHub

  1. Click + New Repository on the right hand corner on the menu bar
  2. Name the new repo
  3. Don't initialize with or .gitignore yet to avoid conflicts at this time
  4. Copy the new repo's URL on clipboard

Create repo in local directory

  1. Open terminal
  2. cd into the project directory
  3. Initialize local repo: git init
  4. Stage all changes in current directory, i.e., all files in the curent directory to the repo: git add --all
  5. Commit all stages files

Linking the local repo with the remote repo

  1. Add the remote repo to the local repo, and alias it as 'origin': git remote add origin copy-new-repo-URL
  2. Verify the remote repo: git remote -v
  3. Push commits to github repo: git push origin master(or branch name)

Troubleshoot error message: ' Permission denied (publickey)'.

  1. Check for existing ssh key:
  2. Generate a new ssh key:
  3. Add the ssh key to Github account:å


  • Adding an existing project to GitHub using the command line: