Jun 212014
 

Quick setup — SSH

We recommend every repository include a README, LICENSE, and .gitignore.

Create a new repository on the command line
mkdir newreponame (md newreponame) on Windows commandline.
cd newreponame

      touch README.md

    • git init
    • git add README.md
    • git commit -m “first commit”
    • git remote add origin git@github.com:githubusername/RH.git
    • git push -u origin master

Push an existing repository from the command line

  • git remote add origin git@github.com:githubusername/RH.git
  • git push -u origin master

Quick setup — HTML

      touch README.md

    • git init
    • git add README.md
    • git commit -m “first commit”
    • git remote add origin https://github.com/githubusername/RH.git
    • git push -u origin master

Push an existing repository from the command line

  • git remote add origin https://github.com/githubusername/RH.git
  • git push -u origin master
Jun 202014
 

Error when running “git push origin master”.

Robs-MacBook-Pro:gitrepo1 localuser$ git push origin master
remote: Permission to githubuser1/gitrepo1.git denied to githubuser2.
fatal: unable to access 'https://github.com/githubuser1/gitrepo1.git/': The requested URL returned error: 403

I simply added the user githubuser2 as a collaborator on gitrepo1 and it worked.

Robs-MacBook-Pro:gitrepo1 localuser$ git push origin master
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 383 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://github.com/githubuser1/gitrepo1.git
   6b70d17..0ec0b91  master -> master
Robs-MacBook-Pro:gitrepo1 localuser$