Changes between Version 2 and Version 3 of Doc/SCDB/Git
- Timestamp:
- Jan 19, 2010, 7:47:47 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Doc/SCDB/Git
v2 v3 8 8 == Why Git? == 9 9 10 [http://git-scm.com Git] is one of the new generation ''Version Control System'' (VCS). It belongs to the family of ''Distributed VCS''. Compared to SVN, based on the ''Centralized VCS'' parad ygm, each user has its own copy of the full repository (''clone'') instead of a working copy of only one revision of the central repository. In fact, in the DVCS model, there is no need of a central repository, this is just a project decision. All users exchange their contributions through ''fetch'' and ''pull'' operations.10 [http://git-scm.com Git] is one of the new generation ''Version Control System'' (VCS). It belongs to the family of ''Distributed VCS''. Compared to SVN, based on the ''Centralized VCS'' paradigm, each user has its own copy of the full repository (''clone'') instead of a working copy of only one revision of the central repository. In fact, in the DVCS model, there is no need of a central repository, this is just a project decision. All users exchange their contributions through ''fetch'' and ''pull'' operations. 11 11 12 12 DVCS model is very attractive as a complementary tool to SCDB for the following reasons: … … 16 16 * Some DVCS, like [http://git-scm.com Git], allows to easily pack together a set of revision into only one. This allows to keep a cleaner history in main branches when doing incremental development. 17 17 18 A feature present in many DVCS is the ability to be used to mirror a SVN central repository and act as a replacement of the SVN working copy. One command allows bi-directional synchroni sation between SVN and the DVCS repository. In [http://git-scm.com Git], this is provided by `git svn` command.18 A feature present in many DVCS is the ability to be used to mirror a SVN central repository and act as a replacement of the SVN working copy. One command allows bi-directional synchronization between SVN and the DVCS repository. In [http://git-scm.com Git], this is provided by `git svn` command. 19 19 20 20 == SCDB and SVN == … … 63 63 == Using Git for Everyday Operations == #GitEveryDay 64 64 65 After [#GitMirror setting up] the initial Git repository as a mirror of your SVN configuration database, you can use all [http://git-scm.com Git] commands and features, in particular ''branch e'' and ''merge''.65 After [#GitMirror setting up] the initial Git repository as a mirror of your SVN configuration database, you can use all [http://git-scm.com Git] commands and features, in particular ''branch'' and ''merge''. 66 66 67 As mentioned [#GitMirror above], the main restriction is that all synchroni sation has to be done from the `master` branch. This is not a strict requirement and there is no way to enforce it. The reason for this is to avoid potential issues with Git `rebase` operations (history rewritting), something that cannot be implemented with SVN. Because of this restriction, you '''must avoid''' doing a `rebase` in the `master` branch, in particular any `rebase` that may impact revisions already committed in SVN.67 As mentioned [#GitMirror above], the main restriction is that all synchronization has to be done from the `master` branch. This is not a strict requirement and there is no way to enforce it. The reason for this is to avoid potential issues with Git `rebase` operations (history rewriting), something that cannot be implemented with SVN. Because of this restriction, you '''must avoid''' doing a `rebase` in the `master` branch, in particular any `rebase` that may impact revisions already committed in SVN. 68 68 69 69 Another restriction is that you should not clone the Git mirror, except for very special purposes: `git svn` will not work properly on such a clone. Instead create another [#GitMirror mirror] of the SVN repository using `git svn clone`. … … 71 71 If you are new to [http://git-scm.com Git], you may want to read the [http://git.or.cz/course/svn.html GIT - SVN Crash Course] that introduces Git concepts and commands for people familiar with SVN. You need to be aware of the following important differences in the way [http://git-scm.com Git] tracks changes compared to SVN: 72 72 * Output of commands like `git status` is formatted very differently from `svn status`. On the other hand, [http://git-scm.com Git] always provides the most sensible commands to use in a given state of the Git working copy. 73 * No tracking of directory per-se: directory are tracked (including renames) only a part of the tracking of the files they contain. That means that empty directory existing in the SVN repository will not be created in the Git mirror. This should generally not be a problem. Note that this behavio ur is common to many DVCS.73 * No tracking of directory per-se: directory are tracked (including renames) only a part of the tracking of the files they contain. That means that empty directory existing in the SVN repository will not be created in the Git mirror. This should generally not be a problem. Note that this behavior is common to many DVCS. 74 74 * There is no `git cp` command and `git mv` is basically the same as standard `mv`. This comes from the way [http://git-scm.com Git] tracks history (based on ''content changes'' and not on files): in fact [http://git-scm.com Git] achieves the same result as `svn cp/rm/mv` using the standard shell commands... 75 75 * In [http://git-scm.com Git], changes to tracked files are not automatically added to the next commit. For them to be part of the next commit, you need to use `git add` (with `-A` option to add everything) or `git commit -a`. This is a little bit disturbing at the beginning but when used to this, this is in fact very handy. `git status` is very explicity about what will be part or not of the next commit.