...
Code Block |
---|
$ git checkout master $ git merge seas-workshop-dev Updating 1288ed3..33e4a4c Fast-forward version-control.rst | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) git: the index |
The Git Index
Git is not really just like Subversion (or most other version control solutions). That's mainly because of the git "index".
- The index is a staging area between your working copy and your local repository.
git add
adds files to the indexgit commit
commits files from the index to the repository.
git: The diff commands uses the index:
git diff
is the difference between your working copy and the index.git diff HEAD
is the difference between your working copy and the local repository.git diff --cached
is the difference between the index and the local repository.
git: the indexRefer back to this illustration if you get confused:
(This image used with permission.) git: Plays well with others
Git Plays Well With Others
Git can integrate with other version control systems. Can
- It can act as a Subversion client (may be the only Subversion client you ever need).
- Can import a CVS repository.
...
Integrating w/ Subversion
You can use git as your Subversion client. This gives you many of the benefits of a DVCS while still interacting with a Subversion repository.
git: Integrating w/ Subversion
Cloning a remote repository:
Code Block |
---|
git svn clone [ -s ] REPO_URL |
The -s
flag informs git that your Subversion repository uses the recommended repository layout (i.e., that the top level of your repository contains trunk/, tags/, and branches/ directories). The HEAD of your working copy will track the trunk.
...