Вы находитесь на странице: 1из 18

AVVENTA WORLDWIDE

Digitas Project Unix and Subversion Startup Manual

Version 0.3 , December 15th, 2006. avVenta WorldWide, Inc Costa Rica Center, Metropolitan Park Barreal, Heredia, Costa Rica Phone 506.2938579

Version Control
Version 0.1 0.2 0.3 Date December 1, 2006 December 14, 2006 December 15, 2006 Person Max Leon Jorge Fernndez Max Leon Comment Initial Draft Added SVN information and some formatting to the document. Putty colors configuration and some minor updates.

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

List of contents
Version Control ___________________________________________________________ 2 List of contents ___________________________________________________________ 3 Introduction to SSH _______________________________________________________ 4 Unix Commands quick reference______________________________________________ 5 Using Unix Commands _____________________________________________________ 6 ls ____________________________________________________________________ 6 touch _________________________________________________________________ 6 rm ___________________________________________________________________ 6 cat + grep _____________________________________________________________ 7 more/less ______________________________________________________________ 7 ln ____________________________________________________________________ 7 find___________________________________________________________________ 7 tar ___________________________________________________________________ 8 pwd __________________________________________________________________ 8 nohup _________________________________________________________________ 8 Understanding Unix permissions and chmod ____________________________________ 9 Users _________________________________________________________________ 9 Groups ________________________________________________________________ 9 Ownership _____________________________________________________________ 9 Permissions ___________________________________________________________ 10 Directories ____________________________________________________________ 10 chmod _______________________________________________________________ 11 Strange numbers... _____________________________________________________ 12 Understanding Unix directory and file colors in console ___________________________ 13 Colors ________________________________________________________________ 13 *NIX file system________________________________________________________ 13 Subversion SVN Quick reference _________________________________________ 14 Subversion commands ____________________________________________________ 15 Check out code from a remote repository ____________________________________ 15 Basic Subversion Commands ______________________________________________ 15 Import Code into Subversion ______________________________________________ 17 Commit your daily work ___________________________________________________ 18

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Introduction to SSH
SSH stands for secure shell and is now a days the most widely remote administration tool. Yes even more than VNC or Remote Desktop. This is basically a remote console encrypted that will allow to work almost as locally on a remote machine. We can use a client to connect from Windows known as PuTTY and while working with Mac we will use the Mac Terminal. Mac OS X underneath is just another UNIX flavor. Well for you to access a machine/device through ssh you will need either to open PuTTY, specify the name or IP of the machine and when prompt provide the username and password or from the terminal in Mac type ssh user@machine, the effect is almost the same, once you have successfully authenticate you will be at the shell on the guest machine. All of the following commands will apply, the flags may vary from one *NIX flavor to another but you can relay on: user@machine:$ man command_I_want_to_use, it will show you a manual for the command with most of its flags and options. Or, user@machine:$ command h / user@machine:$ command help.

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Unix Commands quick reference


We run the development servers on Linux, as you might know Linux is basically a port of UNIX for main frames to 32 bit hardware platform. In case you dont have any previous experience with it. It might look a bit like good old DOS but is far more powerful. Ill list all the commands that you might use more frequently, after that Ill set some examples to get you a better idea of what they do.
Command DOS equivalent cd cd Description and Flaggs cd - will take you to the very previous path you where at. Cd ~$user will take you to the home of the specified user, cd by it self will take you to your own home folder. -l will show the listing in long format with a lot of extra infor, -h with -l will show the size of the file in human readable format, -a will show all the files nad folders including the hidden ones. -f will force the deletion of a file without asking for confirmation, -r will delete recursevly in conjunction with -f will allow to delete folders and their inner content. -i will ignore the case, -r will search recursivly form a specific path output pager, works like cat but will let you navigate by line or page the output same as more but will allow navigation back and forward. -s will create a soft link (shorcut) this should be the only flag you will need since the hard links are not very advisable to use in a development enviroment. -name will look for the specified name on the command line. tar is a unix command to compress information, can be combined with other compressiona algorithms. To create a regular tar file -cvf are the standard flags, using z or j will use either bzip or bzip2 to get a higher rate of compression. Once you type this and hit enter, the absolute path where you are standing at the moment will show on the screen. sends a process to run on the background

ls touch rm cat grep more less ln find

dir

del

find

tar pwd hohup

zip in a way

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Using Unix Commands


There are also some other commands that are extremely useful, those are | and <>, these are used to redirect the output of other commands. user@machine:$ is more or less the standard when you are looking a console window)

ls
user@machine:$ ls The result will list the files and folders; most likely there will be some colors involved. You will find the color code for this at the appendix. Now, if you need to know the size of a specific file, the owner of the file or its permissions, (also a permissions brief resume will be available on the appendix), you will need to type this: user@machine:$ ls -alh file.txt This will display the whole info about file.txt, something like this will show up -rw-r--r-- 1 mleon IT-SUPPORT 2.6M Nov 20 16:00 file.txt This means -rw-r--r-- there are 10 fields, the first one is to indicate if it is a directory, it is not then is black, the following 3 are the permissions of the owner of the file rw- means that you can read and write, the next 3 are the permissions of the group rread only, the last 3 are for the rest of the world and has the same mleon is the owner of the file IT-SUPPORT is the group that the file belongs to. Then you have the size in human readable format (because of the h flag), the date and time of creation and the name of the file.

touch
user@machine:$ touch file2.txt This will simply create an empty file named file2.txt on the specified path, in this case wherever you where standing. This command is also useful went you need to update the date to a file, so if you touch one file that was already created, this command simply updates its modification date to the current date in the server.

rm
user@machine:$ rm file2.txt This command will delete the file2.txt, in most modern distributions of Linux the system will prompt for confirmation before deletion. Now if you add the f flag it will be deleted without requesting confirmation. If there was a directory name stuff and file2.txt was inside that directory and you try this user@machine:$ rm stuff/file2.txt The system will not allow you to delete a directory that has content, if you wish to do so you will need to use the r (recursive) flag, so rm -rf stuff will actually delete de folder and all of its contents including hypothetical directories, subdirectories and files within stuff. So you can do something like this user@machine:$ rm -rf stuff

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

cat + grep
user@machine:$ cat file.txt | grep i test > search.txt This seems to be a pretty difficult, high level command, but, we just combined a couple of commands a | and a >. Lets go slowly. First we have cat, cat is the command that will read the file.txt and show its contents on the screen, instead of that we use a |. The pipe actually redirects the output to another application. In other words we are instructing the shell to read the file.txt and send it to the grep command, (the power and full functionality and features of grep are way out of the scope of this manual but is all about the regular expressions that are so useful1), the we are asking grep to look for test ignoring the case so will match test, Test, tEst, or any other combination you can think of, since we are not being a bit more specific it will match testing as well or any other word that has test on it. OK so we read the file.txt, send it to grep and ask grep to find any matches with test, once that process was done with the > we ask the shell to send the results of the reading and the search to a new file called search.txt. Now if you cat the search.txt file you will see the results of the grep command. For further info on grep you can read the man pages, just type man grep on the shell. To sum up, the most important thing about this example is the use of grep, the | and the > since you can combine them in very imaginative ways to pull data out of files or commands. As a final note, there will be sometimes that grep results can be pretty large, since we can make pretty simpler and repeatable regular expressions, so please be very careful if you are sending this results to a file, since you can get a larger amount of hard disk space and affect all the others users, and this will impact the server performance.

more/less
user@machine:$ more file.txt This will show the content of file.txt but will let you scroll though it line by line or page by page, is quite useful while you are looking for something specific. You can even apply searches through the document, the command less do the same but back and forth instead just forward as more does.

ln
user@machine:$ ln s code/Pontiac/content/xml/ Pontiac_xml This will create a shortcut from code/Pontiac/content/xml to the Pontiac_xml on the home folder of user. The mayor difference between a shortcut and a soft link is that for the OS the ln is transparent will almost treat Pontiac_xml as a real folder directly on the home of user while will it be itself on the actual path.

find
user@machine:$ find /path/to/where/you/think/the/file/is name file.txt This command will look for a file named file.txt recursively inside /path/to/where/you/think/the/file/is and will display the actual path if it finds it. Quite useful if you dont know where is at and you run it at the root of the file system (see appendix for details on UNIX file structure).

http://www.gnu.org/software/grep/doc/ . Also you should try user@machine:$man grep 7

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

tar
user@machine:$ tar cvf stuff.tar stuff This will basically create one file that will have everything that is inside the directory stuff and will name it stuff.tar, if you need to compress it a bit more you can choose either to add the z or j flags to create them. Example: tar zcvf stuff.tar.gz stuff or tar jcvf stuff.tar.bz2 stuff the compression ratio of these two is actually higher than zip and it can be open on windows by winrar. If you get a tar file and you need to open it then you will have to replace the flag c by x, c stands for create and x for extract. In other words, if you have a project.tar.gz you will need to run: user@machine:$ tar zxvf project.tar.gz (the v flag is optional, means verbose but is good to see what is being un-tared). If the file was project.tar.bz2 then tar jxvf will be the way to go.

pwd
user@machine:$ pwd This will simply display the path where you are at the moment. The display in this case is most likely /home/user.

nohup
user@machine:$ nohup tar zcvf smith_sonian_library.tar.gz smith_sonian_library & This will tarzip the Smith Soninan Library and will do it in the background, the whole idea is for you either to keep working on the shell while the process runs or for you to be able to close the shell and let it run until is over without worrying about a broken connection.

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Understanding Unix permissions and chmod


This is a topic that has been beaten to death both in books and on-line. For some reason, it seems that it is one of the most common misunderstandings that people have to face when learning how to write and/or configure their first cgi programs. This tutorial aims to clarify the concepts involved. Note that we will be referring to UNIX in a generic sense in this article. Most of what we are going to discuss here applies to all UNIX flavors (such as Linux, SVR4, BSD, etc.) It is also a good idea to type man chmod to check for the specific details on your system, too.

Users
A UNIX system serves many users. Users are an abstraction that denotes a logical entity for assignment of ownership and operation privileges over the system. A user may correspond to a real-world person, but also a type of system operation. So, in my system, I have user 'nick' that corresponds to me, but I also have user 'www' which corresponds to the privileges necessary to operate the local webserver. UNIX doesn't care about what the user means for me. It just knows what belongs to any given user and what each user is allowed to do with any given thing (file, program, device, etc) on the system. UNIX identifies each user by a User ID (UID) and the username (or login) such as 'nick' and 'www' is just an alias to the UID that makes humans more comfortable.

Groups
Users can be organized in groups. A user may belong to one or more groups of users. The concept of groups serves the purpose of assigning sets of privileges for a given resource and sharing them among many users that need to have them (perhaps because they are all members of a project working team and they all need access to some common project files). So, on my system user 'nick' and user 'www' both belong to the group 'perlfect'. This way, they can have some shared privileges over the files for this site. User 'nick' needs them to edit the site, and user 'www' needs them to manage the webserver that will be publishing the site.

Ownership
Every file in UNIX has an owner user and an owner group. So, for any file in the system, user 'nick' may have one of the following ownership relations: - nick owns the file, i.e. the file's owner is 'nick'. - nick is a member of the group that owns the file, i.e. the file's owner group is 'perlfect'. - nick is neither the owner, nor belonging to the group that owns the file

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Permissions
Every file on the system has associated with it a set of permissions. Permissions tell UNIX what can be done with that file and by whom. There are three things you can (or can't) do with a given file: read it, write (modify) it and execute it. Unix permissions specify which of the above operations can be performed for any ownership relation with respect to the file. In simpler terms, what can the owner do, what can the owner group do, and what can everybody else do with the file. For any given ownership relation, we need three bits to specify access permissions: the first to denote read (r) access, the second to denote (w) access and the third to denote execute (x) access. We have three ownership relations: 'owner', 'group' and 'all' so we need a triplet for each, resulting in nine bits. Each bit can be set or clear (not set). We mark a set bit by its corresponding operation letter (r, w or x) and a clear bit by a dash (-) and put them all on a row. An example might be rwxr-xr-x; what this means is that the owner can do anything with the file, but group owners and the rest of the world can only read or execute it. Usually in UNIX there is also another bit that precedes this 9-bit pattern. You do not need to know about it, at least for the time being. So if you try ls -l on the command prompt you will get something like the following: [nick@thekla src]$ ls -l -rwxr-xr-x 1 nick users 382 Jan 19 11:49 bscoped.pl drwxr-xr-x 3 nick users 1024 Jan 19 11:19 lib/ -rwxr-xr-x 1 nick users 1874 Jan 19 10:23 socktest.pl The first column here shows the permission bit pattern for each file. The third column shows the owner, and the fourth column shows the owner group. By the time, the information provided by ls -l should be enough for you to figure out what each user of the system can do with any of the files in the directory.

Directories
Another interesting thing to note is that lib/ which is a directory, has permissions, too. Permissions take a different meaning for directories. Here's what they mean: - read determines if a user can view the directory's contents, i.e. do ls in it. - write determines if a user can create new files or delete file in the directory. (Note here that this essentially means that a user with write access to a directory can delete files in the directory even if he/she doesn't have write permissions for the file! So be careful with this.) - execute determines if the user can cd into the directory.

10

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

chmod
To set/modify a file's permissions you need to use the chmod program. Of course, only the owner of a file may use chmod to alter a file's permissions. chmod has the following syntax: chmod [options] mode file(s). The 'mode' part specifies the new permissions for the file(s) that follow as arguments. A mode specifies which user's permissions should be changed, and afterwards which access types should be changed. Let's say for example: chmod a-x socktest.pl This means that the execute bit should be cleared (-) for all users (owner, group and the rest of the world). The permissions start with a letter specifying what users should be affected by the change; this might be any of the following: u the owner user g the owner group o others (neither u, nor g) a all users This is followed by a change instruction which consists of a +(set bit) or -(clear bit) and the letter corresponding to the bit that should be changed. Let's see some examples: $ ls -l socktest.pl -rwxr-xr-x 1 nick users $ chmod a-x socktest.pl $ ls -l socktest.pl -rw-r--r-- 1 nick users $ chmod g+w socktest.pl $ ls -l socktest.pl -rw-rw-r-- 1 nick users $ chmod ug+x socktest.pl $ ls -l socktest.pl -rwxrwxr-- 1 nick users $ chmod ug-wx socktest.pl $ ls -l socktest.pl -r--r--r-- 1 nick users

1874 Jan 19 10:23 socktest.pl*

1874 Jan 19 10:23 socktest.pl

1874 Jan 19 10:23 socktest.pl

1874 Jan 19 10:23 socktest.pl*

1874 Jan 19 10:23 socktest.pl

11

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Strange numbers...
You might have encountered things like chmod 755 somefile and of course you will be wondering what this is. The thing is, that you can change the entire permission pattern of a file in one go using one number like the one in this example. Every mode has a corresponding code number, and as we shall see there is a very simple way to figure out what number corresponds to any mode. Every one of the three digits on the mode number corresponds to one of the three permission triplets. (u, g and o) Every permission bit in a triplet corresponds to a value: 4 for r, 2 for w, 1 for x. If the permission bit you add this value to the number of the permission triplet. If it is cleared, then you add nothing (some of you might notice that in fact, the number for a triplet is the octal value corresponding to the three-bit pattern) if you don't know what an octal value is, it doesn't really matter, just follow the instructions) So if a file has rwxr-xr-x permissions we do the following calculation: Triplet for u: rwx => 4 + 2 + 1 = 7 Triplet for g: r-x => 4 + 0 + 1 = 5 Tripler for o: r-x => 4 + 0 + 1 = 5 Which makes: 755 So, 755 is a terse way to say 'I don't mind if other people read or run this file, but only I should be able to modify it' and 777 means 'everyone has full access to this file'.

12

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Understanding Unix directory and file colors in console


Colors
The colors may vary from one flavor to another but they seem to be quite constant in the system V flavors at least, the BSD (like Macs OS Darwin wont show any colors by default doe). Color convention: Blue, is a directory. Green, the file is an executable. Red, the file is compress file. Cyan, is not an actual file but a soft link. White is just a file.

*NIX file system


The *NIX file system is radically different than other platforms like Microsofts. It is design as a tree but the storage units (network, hard drives, external drives, removable drives, etc., are handle at least from the user point of view as files and folders. I know this sound very odd but once you get familiar with it is actually quite useful. There are no C:, D: or any other letter for that matter and if you run out of space you can plug another storage unit, link it to a folder, copy the data over and end of story you will have more space available. The basic file structure that is available in every *UNIX flavor to the best of our knowledge is as follows: / /etc /var /usr /sbin /root /home /dev /boot /lib /tmp This is the very root of the file system, everything else is under it. This folder contains all the configuration files for the OS and its services, you might think of this in a way as the Windows folder in a Microsoft machine. You can find all the logging and miscellaneous files for the system. Lets say is like Program Files, it holds most of the applications for the users. Is like system32, all the commands that need to administrator of the system, /usr/sbin is mostly alike. The home of the root who is the Administrator of the *NIX system. It holds all the users folders, is an equivalent for Documents and Settings. where all the devices lay, the sound card, video card, optical drives, etc This has all the files that the system uses to boot up. Holds all the dependencies to run programs. Quite as it names indicates is the one that holds all the temporary files.

13

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Subversion SVN Quick reference


Subversion is a revision control system and it was designed as a CVS replacement. Given a general idea of how the system works and all the features it has, we can find that all commits are truly atomic operations, so if you interrupt a commit operation, this wont cause any inconsistency in the repository. We can have a full access to the revision history even went we remove one file. As every file, the directory also has its own version control, so we can move or rename a directory without affecting its revision history. Native support of binary files. Branching and Tagging are easy. Those features among others make SVN a very powerful revision control tool2. SVN Command svn add svn svn svn svn commit add rm status Description and flags Update your working copy. This command should be performed every time you are about to make a commit. Commit all your changes to the revision control. Add new files to the version control. Remove files not longer necessary or used. List all files and whether they are: - M: modified - A: added - C: in conflict - ?: status unknown Changes your local file to whatever is on the repository. Lists changes log file. After you fix a conflict file, you need to use this before you can commit. Update all the content of your working copy with the last revision on the server. You can use with the r ### so you can update your code to a specific revision. Checkout a specific project from the SVN repository.

svn svn svn svn

revert log resolved up

svn co

You can find more information about SVN on: http://svnbook.red-bean.com/ 14

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Subversion commands
Check out code from a remote repository
user@machine:$ svn checkout http://svn.collab.net/repos/svn/trunk dev OR user@machine:$ svn co http://svn.collab.net/repos/svn/trunk dev ALSO user@machine:$ svn+ssh://user@server/svn/gmc dev This command will check out a working copy of the subversion source code into a new subdirectory called dev. Note, this is just an example, checking out the subversion source could take a while, so dont do it. You would generally substitute the URL with the one you are trying to access, and change the working directory to something different. On the majority of the commands you can set the --username parameter and the --pasword to help automate things, instead of being prompted for them. Once you create a local working copy, your client should really cache that information, however. Also you can use Kerberos is your terminal client supports it, by doing: user@machine:$ kerberos it will ask for your network password just once, and after that you wont need to give it again until your session dies.

Basic Subversion Commands


user@machine:$ svn update OR user@machine:$ svn up ALSO user@machine:$ svn up r 123 Run this in your project directory to get the latest changes from the source control server. svn update -r 123 Run this in your project directory to update to the specific revision 123. user@machine:$ svn status OR user@machine:$ svn st Run this in your project directory, gives you the status of all the files and directories. If it returns nothing, then you are in sync. M before a file means modified, ? means the file is not in source control, C means that the file is in conflict, A the files was added to the source control and D which means that files is up to be removed from the repository. user@machine:$ svn revert This will revert the changes that you have made to your working copy. user@machine:$ svn diff filename.java This will show the differences between filename.java and the working copy. This is most useful after running an svn stat and seeing that the file is modified. You can then run this command to see what the differences are. 15

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

user@machine:$ svn revert filename.java This will revert all changes you have made to filename.java back to the copy in the repository. user@machine:$ svn revert -R * This will revert all changes you have made to the entire project back to the repository version. user@machine:$ svn -v list This will list the files in source control for the current workspace directory. user@machine:$ svn -v list http://svn.collab.net/repos/svn/trunk This will list all files in source control at the particular subversion repository URL. Fairly useful if you want to see what the structure is before doing a checkout. user@machine:$ svn info Gives you info about the current working copy, including the URL of the repository it points to, and the last changed date/author. user@machine:$ svn commit -m Adding new function filename.java Commit the changes in filename.java, and give it a useful message. Using the messages is highly important down the road when you want to figure out what a particular change did. Make sure you use them, since we do not allow commits with empty commit messages. user@machine:$ svn commit -m Adding lots of new functions Use this function without the filename to commit all changes to all files. This is useful when you have a set of changes spanning multiple files. user@machine:$ svn log OR user@machine:$ svn log filename.java ALSO user@machine:$ svn log --limit 5 http://svn.collab.net/repos/svn/trunk Use this function to take a look at the log messages. The first one is for the entire working copy; the second one, returns all the log messages for that file and the last one shows just the last 5 log messages on a web repository. user@machine:$ svn add newfile.java Add a file or directory to version control. Note that you still have to commit to actually send the file to the source control server. You also can only use this command from within a working copy directory, meaning if you havent used source control on that directory you will need to import it first. user@machine:$ svn move filename.java newfilename.java Allows you to rename or move files within source control. You can either use filenames in your local repository, or you can even pass in two URL locations to have it be moved/renamed on the server side. This command is the same as doing a copy and then a delete. user@machine:$ svn copy MySource MyNewSource Allows you to copy a file or directory, either with local files, or on the repository using the URL syntax. 16

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

user@machine:$ svn delete filename.java Deletes the filename from source control. Note that the filename will still exist in older revisions, but will be deleted from the current revision. user@machine:$ svn blame filename.java This is one of my favorite commands in subversion. This lists out the file, giving the revision and person who changed every single line in the file.

Import Code into Subversion


user@machine:$ svn import -m Importing the files MySource http://svn.theserver.net/svnroot/mysource Imports the directory MySource and all files contained within into the subversion server. The URL can be several levels deep or more. Note: once you import a source code directory, you should remove the directory and then checkout the directory so that you can have a proper working copy. Oh, and back up your files before you delete them. I dont want any nasty emails about how you lost source code.

17

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Commit your daily work


To commit your work to the SVN server, you have to follow the next steps: 1.) When an Issue is done, we look which files were updated in the process using SVN command ($svn status). This command will tell us all the files modified (M), those which arent under SVN control (?) and those which have any conflict (C). 2.) If you have any files please go through the following process: - Check very carefully which file(s) is(are) in conflict. - How to solve the conflict depends on the kind of file you are dealing with, if you have a binary file like swf, png, jpeg, etc; and if you are pretty sure and confident that your file is the latest file, you should erase all the duplicates (there will some files with the r### termination, for example masthead.swf.r2020 those refers to the revision number, these kind of files need to be erased too) - If you are dealing with a non-binary file like a jsp, css, js for example, you will get a conflict inside the file, so you should lock for which lines have any kind of conflict (you will identify those as soon as you get something like <r.2020> inside the code, or <mine> or any kind of special tag inside the code that you now it not right). You should check all the conflict lines and try to get one line that contains all the changes in a right way. Yes, it may be hard, so you might need to find the last person who modified the file and ask him/her about that change3. After that you should run $svn resolved to that file and be sure that everything was solved in the right way. 3.) Identify the files that need to be correctly versioned, for example: $GMVS/src/app/jsp/certified/CarFax.jsp $GMVS/src/web/javascript/main.js $GMVS/src/web/flash/logo.swf $GMVS/images/logo.jpg 4.) Ensure that the files do not contain changes related to issues that are not slated to be deployed. If these changes exist, the changes MUST be removed (preferably by some automated, known-reliable mechanism) before commitment is attempted. This is only possible for text files. Binary files cannot be versioned as easily as text files, so ensure that the correct version of the binary file(s) is (are) being deployed. 5.) Once we have this file list, if we need to add a new one to the repository, we just use the SVN command to add files (this can be use for one file o for N files using wildcards - $svn add folder/name*.* - ): $svn add /GMVS/src/app/jsp/certified/CarFax.jsp $svn add /GMVS/src/web/javascript/main.js $svn add /GMVS/src/web/flash/logo.swf $svn add /GMVS/images/logo.jpg 6.) To make the final commit, you just have to use the commit command and make sure it has a very clear description of the changes that were made in that commit. We use the JIRA Issue Number so we can have a better description of the change (using m as parameter and the comment, look at the examples). You can use wildcard here too (ex. $svn commit folder/name*.* m GMVS-100). $svn commit /GMVS/src/app/jsp/certified/CarFax.jsp /GMVS/src/web/javascript/main.js /GMVS/src/web/flash/logo.swf /GMVS/images/logo.jpg m GMVS-100 7.) Please make sure that you kept a copy of the revision number that SVN gives you.
If you want to see who was the last person who updated the file, just do $svn log v filename.aaa and you will get all the change list of that file.
3

18

avVenta Worlwide, Inc. | (506) 293-8579 , (506) 239-5219 | info@avVenta.com | www.avVenta.com

Вам также может понравиться