Git Brown Bag – A quick primer on some features of git. – Quick History



Git Brown Bag – A quick primer on some features of git. – Quick History

0 0


git-brown-bag


On Github simoncomputing / git-brown-bag

Git Brown Bag

A quick primer on some features of git.

-Raymond Tang

Quick History

  • Created by Linus Torvalds in 2005.
  • Distributed Source Control
  • Safeguards against corruption, malicious or accidental.
  • Not be CVS

Distributed

  • Always committing to local.
  • Git can have any number of remote upstreams.
  • A branch can be marked as tracking an upstream branch.

Branch branch branch

  • Share as often and without limits.
  • Isolate your work to stay focused.
  • Try different approaches without pushing incomplete features.
  • Inherent code review process.

git basics

  • Adding, ignoring, staging and committing.
  • Branching
  • Merging
  • Push and pull
  • Dealing with Conflicts

Features

  • Partial committing
  • Local commits
  • Pull with rebase
  • Easy branch, tag, checkout, revert, cherry pick...
  • Diff across branches, commits, etc.

Workflow Overview

  • Types of branches
  • Production
  • Master
  • Development
Source

Workflow

Get Latest. Isolate Work Test Share Repeat

Workflow

Get Latest.
  • git pull origin master
Isolate
  • git checkout -b feature
Work Test
  • merge updated master into feature, play
Share
  • merge feature, push, close issue
Repeat.

Best Practices

  • Stick to the feature branches.
  • Concise commit messages
  • Pull with Rebase.
  • Useful commits

Useful Commands

  • Configure your username/email.
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
Pull with Rebase always.
git config branch.autosetuprebase always

Git Tools

Useful References