Gitting into Git

Introduction to Using Git

Pyladies, November 18, 2015

While you wait...

  1. Install a text editor (Sublime)
  2. http://github.com
  3. create an account
  4. write your username on sheet
  5. install git

on a mac: http://sourceforge.net/projects/git-osx-installer/

on a pc: http://msysgit.github.io

Avery Anderson

@averycodes

http://averycodes.com

Software Engineer, Minerva Project

Git

versioning for programmers

Github

git repository hosting service

Version Control Vocab

Versioning

add grapefruit

remove potatoes

add milk

add butter

Versioning as a set of instructions

The Diff

on github

in commandline

Command Line Interface

Activity: Configuring your identity

Open the command line tools, add your name and email

git config --global user.email <email>
git config --global user.name <name>
git config --list

https://github.com/averymanderson/teaching-git

git clone <clone url>

Activity: Cloning a Repository

Navigate to github, copy the https clone url and clone the repository to your computer

git status

git add -p

git commit -m "adding name"

Activity: Committing a change

Add your name to example.txt, make a commit with an informative commit message

git push

Quick Discussion:

Local repository versus remote repository

git pull

Quick Experimental Interlude

Activity: Pushing and Merge Conflicts

Push your changes to the server. Pull updates from the server. Resolve merge conflicts.

Push your changes to the server. Pull updates from the server. Resolve merge conflicts.

Review: The whole process and what's happening

Avery's Laptop

Github

Lynn's Laptop

olives

prunes

olives

prunes

olives

prunes

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

Avery's Laptop

Github

Lynn's Laptop

olives

prunes

prunes

carrots

beans

tomatoes

olives

sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

Avery's Laptop

Github

Lynn's Laptop

olives

prunes

prunes

carrots

beans

tomatoes

olives

sugar

"add vegetables"

"remove olives"

"remove prunes add sugar"

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

Avery's Laptop

Github

Lynn's Laptop

olives

prunes

prunes

carrots

beans

tomatoes

olives

sugar

"add vegetables"

"remove olives"

"remove prunes add sugar"

push

push

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

Avery's Laptop

Github

Lynn's Laptop

carrots

beans

tomatoes

sugar

prunes

carrots

beans

tomatoes

olives

sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

Avery's Laptop

Github

Lynn's Laptop

carrots

beans

tomatoes

sugar

prunes

carrots

beans

tomatoes

olives

sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

pull

pull

Avery's Laptop

Github

Lynn's Laptop

carrots

beans

tomatoes

sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

carrots

beans

tomatoes

sugar

carrots

beans

tomatoes

sugar

But what about the prunes???

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

Avery's Laptop

Github

Lynn's Laptop

carrots

beans

tomatoes

sugar

prunes

carrots

beans

tomatoes

olives

sugar

+ carrots

+ beans

- olives

+ tomatoes

- prunes

+ sugar

pull

pull

git diff

git branch <branchname>

git checkout <branchname>

git merge <branchname>

Activity: Branching and merging

Branch off from master. Add some people to the list who should be pyladies. Merge your branch back into master

Quick Discussion:

Why would you branch?

GUI Tools!

Learn more git

https://try.github.io/

More Resources

http://averycodes.com/blog/gitting-into-git/

Gitting into Git

By Avery A.

Gitting into Git

  • 280

More from Avery A.