顯示具有 Git 標籤的文章。 顯示所有文章
顯示具有 Git 標籤的文章。 顯示所有文章

2014年5月21日 星期三

Working Locally with Git

image

 

Create a local repository

image

image

image

 

Modify a file, add to stage, commit to repository

image

image

 

See difference between 2 versions

image

 

Create 2 files, add to stage, commit to repository, see diff

image

-u: only add updated files (modified or deleted)

-A: add all files

image

image

 

Modify 2 files, add separately to stage, commit separately to repository

image

image

image

 

Example:

1. Delete 1 file, add to stage with –u option

2. Create 1 file, add to stage with file name

3. Rename 1 file, add to stage with –A option

4. Commit all to repository

 

1. Delete 1 file, add to stage with –u option

image

2. Create 1 file, add to stage with file name

image

3. Rename 1 file, add to stage with –A option

image

4. Commit all to repository

image

 

Undo 1 change in working copy (checkout)

image

 

Undo multiple changes in working copy (reset --hard)

image

 

Undo the latest commit to staging (reset --soft)

image

image

image

image

image

 

Undo the latest commit (reset --hard)

image

image

image

image

 

Clean working copy (clean -n, -f)

image

 

Ignore files with .gitignore

image

image

image

Git Introduction, Installation(Windows) and Configuration

A Brief History of Version Control

 

1. First Generation

image

 

2. Second Generation

image

VSS: Visual Source Safe

SVN: Subversion

TFS: Team Fundation Server

 

3. Third Generation

image

 

Advantages of DVCS

DVCS: Distributed Version Control System

image

image

 

About Git

image

 

Installing Git on Windows

msysGit (http://msysgit.github.io/)

SNAGHTML111ba6e

SNAGHTML11be2b6

SNAGHTML11c2d3c

SNAGHTML11c6981

SNAGHTML126650e

SNAGHTML126d02f

SNAGHTML1292b2a

SNAGHTML12a5a07

SNAGHTML12a98bb

SNAGHTML12b4668

 

image

git --version

SNAGHTML1317d8e

image

 

Configuring Git

3 different levels of configuration

1. system(- -system)

2. user(- -global)

3. repository()

image

 

image

image

core.autocrlf

1. true: Windows but has cross-platform project

2. false: Windows and NO cross-platform project

3. input: Mac or Linux

 

Repository Level config

image

image

Priority: Repository >> User >> System

User Level overwite System Level, Repository Level overwite User Level

image