The document provides a brief history of revision control systems including SCCS, RCS, CVS, Subversion, and distributed systems like Git, Mercurial, and Bazaar. It discusses the problems with earlier systems that motivated the creation of Git, including issues with CVS and Subversion. It describes how Linus Torvalds created Git to address these problems and support fast, distributed, and non-linear development workflows.
22. History is a DAG To keep all the information and history on the three versions of this tree, Git stores 16 immutable , signed , compressed objects.
34. git init c:gt; mkdir test c:gt; cd test c:est> git init Initialized empty Git repository in c:/test/.git/
35. git add c:est> dir /b cities.cpp cities.h c:est> git add cities.h c:est> git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: cities.h # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # cities.cpp
36. git commit c:est> git commit -m "first commit" [master (root-commit) 207b79d] first commit 1 files changed, 44 insertions(+), 0 deletions(-) create mode 100644 cities.h c:est> git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # cities.cpp nothing added to commit but untracked files present (use "git add" to track)
37. git commit -a c:est> git status # On branch master nothing to commit (working directory clean) c:est> echo "aaa" > cities.cpp c:est> git commit -m "test" # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: cities.cpp # no changes added to commit (use "git add" and/or "git commit -a") c:est> git commit -m "test" -a [master 6eaf41e] test 1 files changed, 1 insertions(+), 210 deletions(-) rewrite cities.cpp (100%)
49. Local branches are yours only c:estest> git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master c:estest> git checkout -b working Switched to a new branch 'working' c:estest> git branch -a master * working remotes/origin/HEAD -> origin/master remotes/origin/master
50. git fetch ; git merge c:estest> git st # On branch master nothing to commit (working directory clean) c:estest> git fetch remote: Counting objects: 4, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From dreamiurg.unfuddle.com:dreamiurg/test 3ade0ca..6309355 master -> origin/master c:estest> git st # On branch master # Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded. # nothing to commit (working directory clean) c:estest> git merge origin/master Updating 3ade0ca..6309355 Fast-forward new.cpp | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 new.cpp