Git

What is Git

A free, open version control system.

Widely used for source code management.

In comparison to SVN, it has decentralized version control system.

 

Using Git

Download:

  • Windows: Git Bash
  • Mac/Linux: download package manager

Profile:

  • git config --global user.name "oToToT"
  • git config --global user.email "ototot@infor.org"
  • git config -l

Using Git

First Repository:

  • git init
  • git status
  • git add
  • git commit
  • git log
  • git show

Using Git

File Status:

  • Changes to be committed
  • Changes not staged for commit
  • Untracked file

File Recovery:

  • git checkout -- <file_name>
  • git reset HEAD <file_name>

Git Branch

Commit:

  • git log --pretty=raw
  • keyword "HEAD"
  • git reflog / git log -g
  • git commit --amend

Cherry Pick

  • git cherry-pick <id>

Git

By Tommy Chiang

Git

  • 395