Workshop

Git is the most popular SCM today

"--distributed-is-the-new-centralized"

 

History

 

 

GIT - the stupid content tracker

 

 

  • made out of need - Linux Kernel SCM of choice was made non-free
  • made out of past experience
  • made for speed and large scale
  • made for the open source community

History

 

2005, original read.me file:

GIT - the stupid content tracker
"git" can mean anything, depending on your mood.

 

- random three-letter combination that is pronounceable, and not
  actually used by any common UNIX command.  The fact that it is a
  mispronounciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the
  dictionary of slang.
- "global information tracker": you're in a good mood, and it actually
  works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks

 

Basic ideas

  • Fast & simple

  • Support for non-linear development 

  • Fully distributed

  • Able to handle large projects

Architectural choices

  • Everything is local
  • Snapshot based
  • Content based IDs
  • Branch oriented

Basic setup

  • download git http://git-scm.com/download/win

  • run and install, put git in your path

  • run git bash here (from anywhere now!)

  • git config --global user.name "John Doe"
    git config --global user.email johndoe@example.com

Creating an Empty repo

 

and if you want to add existing files

  • git commit -am " initial commit"
  • git init

Basic terms

Working directory -

your projects files as on the disk currently

Staging Area -
changes considered for the next commit

Commit history -
Past project states

Checkout -

Take objects or whole state from history to WD

 

 

Basic terms

Branch -

Branching of commits history

Merge  -
connect two commits to new one

Remote -
Another git repo

Fetch-
Transfer commits from remote

Pull -

Fetch & Merge from remote to local

 

 

 

Local workshop

Git Flow

Git in large scale

Class Workshop

GitHub - Git Remote repos @ work

  • Github is a very popular git cloud host 
  • "Fork" is  that github calls cloning an existing repo to your account
  • You can merge/compare across forks
  • The device for suggesting changes is called Pull-request (PR)

 

 

1 thing to bear in mind

  • Everything is local - even merge from origin/develop
    (untill you fetch...)

Distributed Workshop

git-workshop

By Nadav SInai

git-workshop

Git workshop for coding-academy.org

  • 1,580