Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
lirec:version_control_guide [2009-02-04 18:19] davegriffithslirec:version_control_guide [2009-02-04 18:35] davegriffiths
Line 11: Line 11:
 This usage pattern is common to all revision control systems, languages and types of project. You avoid causing other people problems and get the most out of version control if you make it part of your daily programming routine in this way.  This usage pattern is common to all revision control systems, languages and types of project. You avoid causing other people problems and get the most out of version control if you make it part of your daily programming routine in this way. 
  
-The general idea is that code lives on a remote server, and you keep a local copy of the source on your hard drive. You edit files and compile as normal then 'commit' your changes to the remote server. You also need to periodically update your code to get changes that other people have made. +The general idea is that code lives on a remote server, and you keep a local copy of the source on your hard drive. You edit files and compile as normal then 'commit' your changes to the remote server. You also need to periodically update your code to get changes that other people have made. If someone has changed a file you have also changed and you try to commit it, the revision control system will ask you to update it first.
  
 The smaller the changes, and the more frequently you commit code, the better. This is an example day's work: The smaller the changes, and the more frequently you commit code, the better. This is an example day's work:
Line 83: Line 83:
 <code>svn update</code> <code>svn update</code>
  
-This will merge everyone's changes (if any have been made) into your working directory. If there is a conflict (two people have changed the same line) it will emit an error messageand insert both lines into the source file in question with lots of >>>>>>>>>>>>>> characters so it will be obvious what is going on.+This will merge everyone's changes (if any have been made) into your working directory, and print out the status of the files it merges. If there is a conflict (where someone has changed the same line you have) it will put a 'C' next to the filenameeg on the command line: 
 + 
 +<code>  
 +$ svn update 
 +C    GraphNode.cpp 
 +Updated to revision 150. 
 +
 +</code> 
 + 
 +If you have a look at this file, it will indicate the line affected in the following form: 
 + 
 +<code> 
 +<<<<<<< .mine 
 +void GraphNode::ProcessChildren_I_Changed_This(unsigned int bufsize) 
 +======= 
 +void GraphNode::ProcessChildren_I_Changed_This_Too!(unsigned int bufsize) 
 +>>>>>>> .r150 
 +
 + for(vector<GraphNode*>::iterator i=m_ChildNodes.begin();  
 + i!=m_ChildNodes.end(); ++i) 
 +
 + if (*i!=NULL) 
 +
 + (*i)->Process(bufsize); 
 +
 +
 +
 +</code> 
 + 
 +You can then choose which line to use.
  
 ====Diffing==== ====Diffing====
  • lirec/version_control_guide.txt
  • Last modified: 2009-02-09 11:01
  • by 81.188.78.24