Creating a repo
mkdir ~/Hello-World
- Creates a directory for your project called "Hello-World" in your user directory
git init
- Sets up the necessary Git files
touch README
- Creates a file called "README" in your Hello-World directory
mkdir ~/Hello-World
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin https://github.com/username/Hello-World.git
git push origin master
git clone https://github.com/username/Spoon-Knife.git
When a repo is cloned, it has a default remote called origin
that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named upstream
:
cd Spoon-Knife
git remote add upstream https://github.com/octocat/Spoon-Knife.git
git fetch upstream
Adapted from the Github Help Docs