154
edits
Changes
→Svn basic commands
=Svn basic commands=
A few important facts and terminology to help clarify the basic actions:* A The purpose of a code repository is to keep track of all of the modifications done to a project by its team members. *:In a project that is tracked by a code repository (version-controlled , or in short , versioned), you can focus on any changes change during the project's development life; such as, who modified/added/deleted what and when. You can undo work or rollback the work to any development stage of the development and much more.
* SVN is a client/server repository;
** Code is kept resides on a server and those members who have access can copy the whole or parts of the project code to their local machines, work on the whole or parts and then apply their changes back to the server.** Because the code is kept resides on a server, one member may be unaware of the changes made by another member, unless the other has applied the changes to the server and the member has update updated their local copy. **: That is why timely and often frequent communication between amongst team members is highly vital for to the project's success of the project. This can is easily be accomplished through the project wiki page (team page) and IRC* A code repository manages the merging the of modifications of different members' code. However When this may fail and as a result fails, the repository will sometimes be in a conflict state.*: Conflicts can be easily be edited, saved , and resolved using the tools provided by SVN.* A '''Version-controlled or versioned''' file is a file that is handled and being tracked by a repository.
<hr>
* For all the command lines below, note that if If the userid and password is are not set to be saved in svn, then you need to add
<big><pre>
--username stdId --password stpassword
</pre></big>
to the end if each svn command. (userid and password '''ISare''' set to be saved by default, make . Make sure to reboot your lab computer for the uid userid and pass password to be removederased)
== checkout ==
To '''checkout''' is to download the code from a repository server as a whole, or partial, partially to a versioned directory on the client, so that you can start working on the code.
*GUI:
# Create a directory on your local machine
svn checkout svn://zenit.senecac.on.ca/repoid local_directory --username stdId --password stpassword
</pre></big>
== commit ==
* GUI
# Right click on the directory or file that you wish to which you made modifications commit and click on '''SVN Commit''' # In the Commit Dialog box write enter a short description (a few words) to explain explaining what is you have modified and is being committed are committing and then click on okOK.
* Command Line
<big><pre>svn commit locdir\branches\stdId\SomeDirectory
<big><pre>svn commit locdir\branches\stdId\SomeDirectory\somefile.cpp
-m "Added comments to foo() is somefile.cpp"</pre></big>
'''''IMPORTANT: committing as often as you can will make you visible and show that you are actively work working on your project. When working on your branch, use the commit as often as you save your work, and comment your commits as much as you can. A consistent and regular number of commits per week is the best demonstration of your commitment to the project and work.'''''
== update ==
* GUI
*: Right click on the directory or file (that you want it to be updated) update and click on "SVN update"
* Command Line
while in the local directory
OR for a single file
<big><pre>svn update LocalDirecotyPath/somefile.whatever</pre></big>
== '''branch'''ing or '''tag'''ging ==
To branch or to tag is to '''copy''' one directory into another. The purpose of the copying dictates calling it '''branch''' or '''tag'''.
*To '''branch''' is to '''copy''' into '''branches''' directory for development
*To '''tag''' is to '''copy''' into '''tag''' to release the next stage of your project (also called to release a milestone)