Introduction to Git & Github

@lilianakastilio

 

bit.ly/githubfun

1. Set Up

Install

1. Git  git-scm.com

2. Sublime sublimetext.com

3. iTerm iterm2.com

2. CREATE

NEW FOLDER

 $ mkdir gitfun

1. Create a new folder in the terminal

2. Go inside the folder

 $ cd gitfun

3. GIT

WHAT IS IT?

Git is a version control system.

 

It is free and open source!

INITIALIZE

 $ git init

1. Create a new git repo

You can now use the git commands in this folder to track your changes. Hurray!

CHANGE

1. Create a new file in Sublime

 My name is Lili

2. Add a line in the file

 name.txt

3. Save the file in our folder as

STAGE

1. See what changed

 $ git status

2. Stage a file to be commited

$ git add name.txt

COMMIT

1. Commit changes

 $ git commit

2. Add a meaningful commit message:

 Created a new name.txt file

4. GITHUB

WHAT IS IT?

Github is a web based Git repository hosting service

SIGN UP

Create an account on github.com

and login.

New REPO

Create a new repository : github.com/new

ADD REMOTE

 Tell Git about your remote repo

 $ git remote add origin https://github.com/user_name/your_repo.git

PUSH

You can now push all you local changes to the github repo

 $ git push origin master

Git & Github Introduction

By Liliana Kastilio

Git & Github Introduction

  • 1,430