Media Computation Skills Lab

MTEC 1003

Lab 4 - Part 1 - Creating and Setting Up Git Repositories

In this lab, you’ll be:

  1. creating two repositories, one local and one remote
  2. linking the two with each other so that they can be synchronized
  3. associate a name and email address with your local repository

Instructions

Set up Your Local Repository

This will create a local git repository to store your work for this lab. The repository will be in ~/Desktop/yourname/lab-04-version-control.

cd ~/Desktop
mkdir myname
cd myname
mkdir lab-04-version-control
cd lab-04-version-control
ls -al
total 0
drwxr-xr-x  2 bree  staff   68 Feb 26 07:52 .
drwxr-xr-x  3 bree  staff  102 Feb 26 07:52 ..
git init
Initialized empty Git repository in /Users/bree/Desktop/bzuckerman/lab-04-version-control/.git/
ls -al
# in the directory of your repository
git config user.name  "my_user_name"
git config user.email "my@email.address"
git config -l

Create Your Remote Repository

This will create a remote git repository on github. It will also link your local repository with this remote repository. In order to submit your work, you will send your files / changes from your local repository to the remote repository on github.

curl -u 'your github user name' https://api.github.com/user/repos -d '{"name":"lab-04-version-control"}'
Enter host password for user 'bzuckerman':
{
  "id": 17210769,
  "name": "lab-04-version-control",
  "full_name": "bzuckerman/lab-04-version-control",
  "owner": {
    "login": "bzuckerman",
	...
}
git remote -v show
git remote add origin https://github.com/github_username/lab-04-version-control.git 
git remote -v show
origin	https://github.com/bzuckerman/lab-04-version-control.git (fetch)
origin	https://github.com/bzuckerman/lab-04-version-control.git (push)

MTEC 1003 - Media Computation Skills Lab - Spring 2015