Lead Technical Analyst
peter@eltgroth.net
Web Architect
jeremy.heydman@so.mnscu.edu
A system that:
Design goals:
Git takes a stream snapshots by doing a SHA-1 check-sum of everything before it is committed.
And later syncronize with others
Experiment with solutions, merge the best & delete the rest.
Fast comparisons over the complete life of the project
Since Mavericks (10.9) just type 'git' in a terminal.
If you want/need a newer version downlaod it directly from git-scm, use Homebrew, or GitHub Desktop.
Download git for windows or GitHub Desktop.
Fedora:
$ sudo yum install git-all
Debian-based:
$ sudo apt-get install git-all
My favorite GUI
$ git {optional-command-name} --help
Learn Git commands in your browser at try.github.io
$ mkdir myproj
$ cd myproj
$ git init
$ git status
Short Status
$ git status -s
$ git add {file}
$ git add *.java
$ git add *
Diff of modified changes
$ git diff
Diff of staged changes
$ git diff --staged
$ git reset {file-path}
$ git reset *.java
$ git reset *
$ git commit -m '{message}'
Create
$ git branch {branch-name}
Delete
$ git branch -d {branch-name}
$ git checkout {branch-name}
$ git merge {branch-name}
$ git mergetool
Replay a changeset by rewinding to a common ancestor and reapplying each change in turn.
This keeps history more linear and easier to read.
$ git rebase {branch-name}
$ git checkout master
$ git merge experiment
Add
$ git tag -a 0.1.0 "Alpha release"
List All
$ git tag
List matching tags
$ git tag -l {search-string}
List all 1.2 tags
$ git tag -l "1.2*"
$ git log
Show diffs for the last n commits
$ git log -p -{n}
Show abbreviated stats
$ git log --stat
Show a graph
$ git log --graph
Your copy of a repository in at the hosting provider.
$ git clone {path to repo}
$ git clone https://github.com/PeterEltgroth/itconf2016
List
$ git remote
List with URLs
$ git remote -v
Inspect
$ git remote show {optional-remote-name}
Add
$ git remote add {remote-name} {url}
Rename
$ git remote rename {old-name} {new-name}
Remove
$ git remote rm {remote-name}
$ git fetch {remote-name}
Fetch & Merge the remote branch into the current branch
$ git pull {remote-name} {remote-branch}
Push remote branch into the current branch
$ git push {remote-name} {branch-name}
If your fork (or any other repo) already has your C4 commit and then you rebase locally, it WILL cause problems.
A request that a change you made be pulled back into a branch on another copy of the repository.
As a developer submitting a PR, it is generally your responsibility to catch up and resolve any merge conflicts with the branch your PR is targeting.
Created with reveal.js
Source code located at: GITitTogether