Presentation is loading. Please wait.

Presentation is loading. Please wait.

SVN intro (review).

Similar presentations


Presentation on theme: "SVN intro (review)."— Presentation transcript:

1 SVN intro (review)

2 What is it? Software versioning + revision control software
Jobs (some are done external to SVN): File repository Track revisions Rollback Log changes Atomic changes Merging changes from multiple users Best at text-files, but works with binary.

3 Repository A place to store data
svn protocol + server => remote access For us, on niobium ( ) svn://svn.ssucet.org/my_repository Contains several "setting" files User accounts + password Preferences (e.g. access-level for anonymous users)

4 SVN client Options: terminal access GUI through SSH
built-in in Linux (and OSX?) GUI TortoiseSVN on Windows

5 Checkout Creates a local copy TortoiseSVN
The same user can have multiple local copies Only done once Contains many (.svn) folders in each directory No touching these files! TortoiseSVN Create a directory (normal) Right-click on it, select "SVN checkout" Enter the svn repository URL Depending on repo properties, you may have to enter uname/pass Wait!

6 Update Applies new changes (committed from other users / local copies) to a local copy. Done after the initial checkout Should be done often At a minimum before new coding Every 15 minutes or so? Easier to merge changes if done frequently.

7 Update, cont. In tortoise, you will see something like: Colors:
Black: updated a file that you haven't changed Purple: added a new file Green: SVN was able to merge your local changes and the repository changes automatically (double-check it) Brown: A file was deleted Red: Conflict that SVN can't resolve. DON'T IGNORE IT (by clicking OK)

8 Update, cont. Double-click on an Added file and you will see:

9 Resolving conflicts Double-click on the conflicted file to enter the editor. Right click on blocks to merge (or type manually) Click save button and mark-as-resolved button, then close window.

10 Update to Revision Like Update, but updates to a previous (non-head) revision Shouldn't undo local changes (use revert for this)

11 Revert Remove any local changes to (a) file(s).
Can be reverted to head revision, or a previous revision.

12 Commit Propogate local changes to repository Do an update first!
Make sure you enter a log message! You can double-click the file to see changes. RevisionNumber++

13 Deleting / Renaming Files
Must be done through SVN, not normal OS facilities. TortoiseSVN: Right-click on the file Go to Tortoise SVN => Rename… to delete SVN actually deletes and then adds the file Go to Tortoise SVN => Delete… to delete Make sure you do a commit!

14 Log viewing Right click on a File or directory
TortoiseSVN => Show Log Click a revision to show files modified/added/deleted (if a directory) Double-click the lines in bottom pane to view changes in the editor.

15 Common problems to avoid
If you have local changes to xyz.txt and do an update… your version is more current, so SVN should either: Merge changes from the server (if anyone changed it and SVN can resolve) Mark as a conflict (if anyone changed it and SVN can't resolve) Leave it alone otherwise. Don't use the TortoiseSVN => Blame feature! Small / frequent commits are easier than infrequent / huge commits.

16 SVN etiquette Put message on every commit
Talk to anyone working on the same code you are. Avoids duplicated work Avoids stomping on their code Good for the project Don't commit broken code (unless absolutely necessary) Better to comment the broken code out. Don't use SVN in place of face-to-face communication with other users.

17 Branching / Tagging Tagging Branching
Marking a revision number with a name e.g. "Stable version 1.8" Branching Making a copy (cheap copy) of a revision Changes made to the trunk (where you branched from) should propogate to the branches You can merge a branch back into the trunk.


Download ppt "SVN intro (review)."

Similar presentations


Ads by Google