Creating and Setting Up Repositories

Commands for Creation and Set Up of Repositories

For most of our work, we’ll be creating a local repository to work on in class and a remote repository on github to submit our work. Here are some commands we’ll use:

git init

git init - creates a new local repository (using the files in the existing directory)

# in the directory of your repository
git init

git config

git config - configure your user name and email for your commits

# in the directory of your repository
git config user.name  "michaeljordan"
git config user.email "mj@nba.com"

Creating a Remote Repository

You can actually use github as a remote repository. Here’s how you create a remote repository on github through the commandline:

curl -u 'username' https://api.github.com/user/repos -d '{"name":"repo_name"}'
curl -u 'levylorenzo' https://api.github.com/user/repos -d '{"name":"mtec_wk4"}'

git remote add

git remote add - add a remote repository so that you can synchronize changes between it and your local repository

git remote add origin https://github.com/levylorenzo/mtec_wk4.git

The last bit is the url to your repository on github

All together now (part 01 of this lab)

On to Changing and Saving Files