Benutzer:MovGP0/SVN

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      


Subversion (SVN)

[Bearbeiten | Quelltext bearbeiten]
Adressierung
URL-Format: http://server/application/branches/file@versionnumber
Example: http://mysvnserver.com/svn/myapp/trunk/myclass.cs@4153
Branch auschecken
svn checkout http://mysvnserver.com/svn/myapp/trunk
Branch erstellen
svn copy http://mysvnserver.com/svn/myapp/trunk http://mysvnserver.com/svn/myapp/branches/feature_TICKET_BEGRÜNDUNG
Branch umbenennen
svn move http://mysvnserver.com/svn/myapp/branches/old http://mysvnserver.com/svn/myapp/branches/new
Branch wechseln
svn switch http://mysvnserver.com/svn/myapp/branches/new@4321
Datei hinzufügen
svn add FILENAME
Datei entfernen
svn delete FILENAME
Commit
svn commit -m "MESSAGE"

Conflict Resolving

[Bearbeiten | Quelltext bearbeiten]
svn resolve --accept working -R ./dir
svn resolve --accept mf -R ./dir

-R = Rekusiv innerhalb des Verzeichnises

Parameter [1]
Kürzel Bezeichnung Beschreibung
e edit Open the file in conflict with your favorite editor, as set in the environment variable EDITOR.
df diff-full Display the differences between the base revision and the conflicted file itself in unified diff format.
r resolved After editing a file, tell svn that you've resolved the conflicts in the file and that it should accept the current contents—basically that you've “resolved” the conflict.
dc display-conflict Display all conflicting regions of the file, ignoring changes which were successfully merged.
mc mine-conflict Discard any newly received changes from the server which conflict with your local changes to the file under review. However, accept and merge all non-conflicting changes received from the server for that file.
tc theirs-conflict Discard any local changes which conflict with incoming changes from the server for the file under review. However, preserve all non-conflicting local changes to that file.
mf mine-full Discard all newly received changes from the server for the file under review, but preserve all your local changes for that file.
tf theirs-full Discard all your local changes to the file under review and use only the newly received changes from the server for that file.
p postpone Leave the file in a conflicted state for you to resolve after your update is complete.
l launch Launch an external program to perform the conflict resolution. This requires a bit of preparation beforehand.
s show all Show the list of all possible commands you can use in interactive conflict resolution.
Merge/Sync with other branches
svn merge http://mysvnserver.com/svn/myapp/trunk --dry-run
svn merge http://mysvnserver.com/svn/myapp/trunk
Reintegration auf trunk
svn switch ^/trunk
svn merge --reintegrate ^/branches/branch
Rollback of already commited changes
svn merge -c -VERSION http://mysvnserver.com/svn/myapp/trunk


Weitere Rezepte

[Bearbeiten | Quelltext bearbeiten]
SVN Ausdrücke filtern
svn st | where {$_ -match "(?=[?|!]).*"}      # get new and deleted
svn st | where {$_ -match "(?=([! ]     C )).*"}
svn st | where {$_ -match "(?=[?|!]).*"} | ?{$_ -notMatch ".*(bin\\[D|d]ebug).*"} | ?{$_ -notMatch ".*(obj\\[D|d]ebug).*"} | ?{$_ -notMatch ".*(\\obj)"} | ?{$_ -notMatch ".*(\\bin)"}
Finden von fälschlich eingestellten Binaries
svn list -R | ?{$_ -match ".*[(bin\\[D|d]ebug)|(obj\\[D|d]ebug)|(bin\\[R|r]elease)|(obj\\[R|r]elease)].*"}
Get-ChildItem -Recurse| ?{$_ -match ".*(\\[(bin)|(obj)]\\).*"}
Ignore-Flag setzen
svn propset svn ignore FILE_OR_DIRECTORY
Dateien nach Name finden
Get-ChildItem -Path "C:\." -Filter FileName.txt -Recurse
Ignorieren einer Liste von Items
  1. create an file for the ignore rules
    New-Item .svnignore -Type File
  2. configure the ignore rules in the file
    Notepad .svnignore
  3. set the content of the file as ignore rule
    svn propset svn:ignore -F .svnignore .

Internetquellen

[Bearbeiten | Quelltext bearbeiten]
  • Fritz: SVN Status Codes. 22. September 2010, abgerufen am 14. August 2013 (englisch).
  • Ben Collins-Sussman, Brian W. Fitzpatrick, C. Michael Pilato: Version Control with Subversion. Abgerufen am 1. Juli 2015 (englisch, Anleitung für SVN v1.7).
  1. Resolve Any Conflicts. In: SVN Book. Abgerufen am 7. Juli 2015 (englisch).