2014年10月28日 星期二
2014年5月22日 星期四
2014年5月21日 星期三
Working Locally with Git
Create a local repository
Modify a file, add to stage, commit to repository
See difference between 2 versions
Create 2 files, add to stage, commit to repository, see diff
-u: only add updated files (modified or deleted)
-A: add all files
Modify 2 files, add separately to stage, commit separately to repository
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
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
Undo 1 change in working copy (checkout)
Undo multiple changes in working copy (reset --hard)
Undo the latest commit to staging (reset --soft)
Undo the latest commit (reset --hard)
Clean working copy (clean -n, -f)
Ignore files with .gitignore
Git Introduction, Installation(Windows) and Configuration
A Brief History of Version Control
1. First Generation
2. Second Generation
VSS: Visual Source Safe
SVN: Subversion
TFS: Team Fundation Server
3. Third Generation
Advantages of DVCS
DVCS: Distributed Version Control System
About Git
Installing Git on Windows
msysGit (http://msysgit.github.io/)
git --version
Configuring Git
3 different levels of configuration
1. system(- -system)
2. user(- -global)
3. repository()
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
Priority: Repository >> User >> System
User Level overwite System Level, Repository Level overwite User Level