Git 101

Introduction to Using Git

While you wait...

  1. Install a text editor (Sublime)
  2. http://github.com
  3. create an account
  4. tell me your username
  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

The Diff

on github

in commandline

Command Line Interface

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

Activity: Configuring your identity

Open the command line tools, add your name and email

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 "<message>"

Activity: Committing a change

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

Quick Discussion:

Local repository versus remote repository

git push

Quick Experimental Interlude

git pull

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.

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/

Git 101: Introduction to Using Git

By Avery A.

Git 101: Introduction to Using Git

  • 1,247