Versionierung mit Subversion - svn: Unterschied zwischen den Versionen
Steff (Diskussion | Beiträge) (Versionierung mit Subversion) |
Steff (Diskussion | Beiträge) |
||
| Zeile 11: | Zeile 11: | ||
=== Making a diff === | === Making a diff === | ||
Diffs, or patches, are text files which include all the changes done in the working copy. If you suggest a new feature in Bugzilla and like to suggest a change which fixes it, upload a patch. | Diffs, or patches, are text files which include all the changes done in the working copy. If you suggest a new feature in Bugzilla and like to suggest a change which fixes it, upload a patch. | ||
| − | To create a diff from the current repository, use the following command: | + | To '''create a diff from the current repository''', use the following command: |
svn diff | svn diff | ||
| Zeile 17: | Zeile 17: | ||
svn diff includes/SpecialMyAwesomePage.php | svn diff includes/SpecialMyAwesomePage.php | ||
Note that SVN defaults to the "unified" diff format, so the "-u" option doesn't have to be passed. | Note that SVN defaults to the "unified" diff format, so the "-u" option doesn't have to be passed. | ||
| + | |||
| + | === Applying a diff === | ||
| + | Subversion does not contain a built in command to apply diffs to the current working copy (for example, to review or commit diffs published in Bugzilla); instead, you can use the regular '''patch unix utility''': | ||
| + | patch -p0 < patch_file | ||
| + | TortoiseSVN has a built-in support for applying a diff. | ||
Version vom 15. Juni 2011, 07:38 Uhr
Snippets
Checkout um Zweige herunter zu laden
Beispiel Mediawiki Extension TitleKey in den Ordner TitleKey setzen:
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/TitleKey TitleKey
Updating the working copy
To update your working copy and get the latest files, use the following command:
svn update #or just: "svn up"
Making a diff
Diffs, or patches, are text files which include all the changes done in the working copy. If you suggest a new feature in Bugzilla and like to suggest a change which fixes it, upload a patch. To create a diff from the current repository, use the following command:
svn diff
Normally, unlike CVS, you don't have to tell SVN which files you changed; however, you may like to diff only a part of the repository. To do that, specify the files to diff:
svn diff includes/SpecialMyAwesomePage.php
Note that SVN defaults to the "unified" diff format, so the "-u" option doesn't have to be passed.
Applying a diff
Subversion does not contain a built in command to apply diffs to the current working copy (for example, to review or commit diffs published in Bugzilla); instead, you can use the regular patch unix utility:
patch -p0 < patch_file
TortoiseSVN has a built-in support for applying a diff.