Changes

Jump to: navigation, search

SVN for School Projects

104 bytes added, 17:14, 15 February 2012
Svn basic commands
== commit ==
To '''commit ''' is to submit the changes in the local files to the repository (on the server)
* GUI
# Right click on the directory or file that you wish to commit and click on '''SVN Commit'''
== update ==
To '''update ''' is to download and apply the modifications made by others to the repository (on the server) to the local files on your own computer
* GUI
*: Right click on the directory or file that you want to update and click on "SVN update"
<big><pre>svn update LocalDirecotyPath/somefile.whatever</pre></big>
== branch/tag ==To '''branch'''ing or to '''tag'''ging ==To branch or to tag is to '''copy''' one directory into anotheron the server. The purpose of the copying dictates calling it this action either a '''branch''' or a '''tag'''.*To '''branch''' is to '''copy''' into the '''branches''' directory or one of its sub-directories for further development*To '''tag''' is to '''copy''' into the '''tag''' to directory as a release of the next stage of your project (also called to release a milestone)
*GUI, Branching
# Right click on '''trunk''' in your local repository files and under the "TortoiseSVN" sub-menu click on "Branch/tag"
# Click on the button at right side of '''To URL''' and to browse and find your '''workspace''' under '''branches ''' directory (ie.eg. ''svn://zenit.senecac.on.ca/oop344_113repXX/branches/stdId'') and select itthat '''workspace'''.# Add the branch task name (that is usually the name of the task to do) to the end of the selected path: ''svn://zenit.senecac.on.ca/oop344_113repXX/branches/stdId/'''nameOfTask'''''# In '''Log message''' type ''"Branching to do what ever task that is to be donenameOfTask"''# Leave the rest of the options to remain as they are and click on okOK.#: This will make a copy of trunk under your within '''workspace/nameOfTask''' on the server.
*GUI, Tagging
# Right click on '''trunk''' in your local repository files and under the "TortoiseSVN" sub-menu click on "Branch/tag"
# Click on the button at right side of '''To URL''' and to browse and find your the '''tags''' directory (ie.eg. ''svn://zenit.senecac.on.ca/oop344_113repXX/tags'') and select itthat '''workspace'''.# Add the tag name (that is usually a release id like R0.6) to the end of the selected path: ''svn://zenit.senecac.on.ca/oop344_113repXX/tags/'''R0.X'''''
# In '''Log message''' type ''"Tagging release whatever"''
# Leave the rest of the options to remain as they are and click on okOK.#: This will make a copy of trunk under your within '''tags/R0.X''' on the server.'''''Note that this will happen on the server; therefore to actually have this applied your local copy, you should update your repository (for this see [[#update|Update]])
* Command Line, Branching
<big><pre>svn copy svn://zenit.senecac.on.ca/oop344_113repXX/trunk
svn://zenit.senecac.on.ca/oop344_113repXX/branches/stdId/nameOfTask
-m "Branching to work on whatever tasknameOfTask"</pre></big>#* Note that the The type of branching we use in here is called a [http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.commonpatterns.feature Feature Branch]
* Command Line, Tagging
<big><pre>svn copy svn://zenit.senecac.on.ca/oop344_113repXX/trunk
svn://zenit.senecac.on.ca/oop344_113repXX/tags/R0.6
-m "R0.6 is released"</pre></big>
'''''Note that branching or tagging occurs on the server. Therefore to have this action applied to your local copy, you need to update your repository (for this see [[#update|Update]])
 
== Merge ==
To '''merge, ''' is to merge back integrate the changes made in a branch in the '''branches''' directory back in the '''trunk''' directory.
*GUI
# First [[#update|updateUpdate]] the whole repository.# Right click on '''trunk ''' and then in '''TortoiseSVN''' sub-menu click on '''merge'''# In merge options, select the second one that is '''Reintegrate a branch''' and then click on next# In '''From Url''' browse and find the branch you just sub-directory under '''branches''' with your completed your task on and then click on nextNext. (ie.eg. svn://zenit.senecac.on.ca/oop344_113repXX/branches/stdId/nameOfTask)#: If browsing is not available you can use the '''repo browser''' to find the path to the branch sub-directory and copy and paste it.# Before merging you can click on test merge to run a simulation and see if the merge is successfulsucceeds# click Click on merge to merge the branch back into trunk. #: note that the merging is happening occurs on your local copy of the code and not in the repositoryon the server
# Edit and resolve possible conflicts
# Compile and test the merged trunk# communicate Communicate with other team members and to make sure that no one else is committing to the trunk.# '''[[#commit|commitCommit]]''' the your changes to trunk # Note others Notify other team members that the you have finished your commit is done!
*Command line
Follow all the precautionary steps stated above and then:

Navigation menu