DPS909 & OSD600 Winter 2017 - Git Walkthrough

From CDOT Wiki
Revision as of 11:51, 11 January 2017 by David.humphrey (talk | contribs) (Created page with "=Git Walkthrough= ===Step 1: get some source=== For this walkthrough, we'll need some source code. Normally you'll write code, but for this walkthrough, we'll borrow some p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Git Walkthrough

Step 1: get some source

For this walkthrough, we'll need some source code. Normally you'll write code, but for this walkthrough, we'll borrow some pre-existing code to make things easier. Let's download the Bootstrap source:

https://github.com/twbs/bootstrap/archive/v4.0.0-alpha.6.zip

Expand the zip file, and open a terminal to your bootstrap-4.0.0-alpha.6/ directory.

Step 2: start a git repo

$ cd bootstrap-4.0.0-alpha.6
$ git init

Note the presence of a new bootstrap-4.0.0-alpha.6/.git/ directory:

$ ls .git
HEAD        config      hooks       objects
branches    description info        refs
  • Client Server (SVN) and Distributed (Git)
  • Snapshots vs. versioned files.
    • Walkthrough -
    • Checksums, SHA-1 (try online)
    • Starting a Git Repo:
      • git init
      • git clone
    • File States:
      • Untracked (not known to git)
      • Tracked: modified, staged, committed
    • The staging area
  • Basic Git Commands and Concepts
    • git help <command>
    • git add
    • git commit, git commit -m, git commit -a
    • git rm
    • git mv
    • git status
    • git log
    • git diff, git diff --staged
    • .gitignore
    • Branches
      • HEAD, master
      • git checkout, git checkout -b
      • git branch, git branch -a, git branch -d, git branch --merged, git branch --contains
      • git merge
      • git rebase
    • Remotes
      • origin, origin/branch
      • git remote
      • git remote add
      • git fetch
      • git pull
      • git push
    • Github, Pull Requests