KDevelop4/Manual/Working with version control systems: Difference between revisions

From KDE UserBase Wiki
m (add category)
(Formattin changes)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Working with version control systems ==
<languages />
<translate>


If you are working with larger projects, chances are that the source code is managed by a version control system such as [http://subversion.apache.org subversion] or [http://git-scm.com/ git]. The following description is written with subversion in view but will be equally true if you use git or any other supported version control system.
== Working with version control systems == <!--T:1-->


First not that f the directory in which a project is located is under version control, KDevelop will automatically notice. In other words: It is not necessary that you tell KDevelop to check out a copy itself when setting up your project; it is ok to point KDevelop at a directory into which you have previously checked out a copy from the repository. If you have such a directory under version control, open the "Projects" tool view. There are then a number of things you can do:
<!--T:2-->
If you are working with larger projects, chances are that the source code is managed by a version control system such as [http://subversion.apache.org subversion] or [http://git-scm.com/ git]. The following description is written with '''subversion''' in view but will be equally true if you use '''git''' or any other supported version control system.


<!--T:3-->
First not that if the directory in which a project is located is under version control, '''KDevelop''' will automatically notice. In other words: It is not necessary that you tell '''KDevelop''' to check out a copy itself when setting up your project; it is ok to point '''KDevelop''' at a directory into which you have previously checked out a copy from the repository. If you have such a directory under version control, open the '''Projects''' tool view. There are then a number of things you can do:
<!--T:4-->
* If your directory has become outdated, you can update it from the repository: Click on the project name with the right mouse button, go to the menu <menuchoice>Subversion</menuchoice> and select <menuchoice>Update</menuchoice>. This will bring all files that belong to this project up to date with respect to the repository.
* If your directory has become outdated, you can update it from the repository: Click on the project name with the right mouse button, go to the menu <menuchoice>Subversion</menuchoice> and select <menuchoice>Update</menuchoice>. This will bring all files that belong to this project up to date with respect to the repository.


<!--T:5-->
* If you want to restrict this action to individual subdirectories or files, then expand the tree view of this project to the level you want and right click on a subdirectory or file name, then do the same as above.
* If you want to restrict this action to individual subdirectories or files, then expand the tree view of this project to the level you want and right click on a subdirectory or file name, then do the same as above.


<!--T:6-->
[[Image:kdevelop-8.png|thumb|600px]]
[[Image:kdevelop-8.png|thumb|600px]]


<!--T:7-->
* If you've edited one or more files, expand the view of this project to the directory in which these files are located and right click on the directory. This gives you a menu item <menuchoice>Subversion</menuchoice> that offers you different choices. Choose <menuchoice>Compare to base</menuchoice> to see the differences between the version you have edited and the version in the repository you had previously checked out (the revision "base"). The resulting view will show the "diffs" for all files in this directory.
* If you've edited one or more files, expand the view of this project to the directory in which these files are located and right click on the directory. This gives you a menu item <menuchoice>Subversion</menuchoice> that offers you different choices. Choose <menuchoice>Compare to base</menuchoice> to see the differences between the version you have edited and the version in the repository you had previously checked out (the revision "base"). The resulting view will show the "diffs" for all files in this directory.


* If you only edited a single file, you can also get the <menuchoice>Subversion</menuchoice> menu for this file by simply right clicking on the corresponding file name in the project view. Even simpler, just right clicking into the editor view in which you have opened this file will also give you this menu option.
<!--T:8-->
* If you only edited a single file, you can also get the <menuchoice>Subversion</menuchoice> menu for this file by simply right clicking on the corresponding file name in the project view. Even simpler, just right clicking into the '''Editor''' view in which you have opened this file will also give you this menu option.
 
<!--T:9-->
* If you want to check in one or more edited files, right click either on an individual file, subdirectory, or whole project and select <menuchoice>Subversion -> Commit</menuchoice>. This will get you into <menuchoice>Review</menuchoice> mode, the third mode besides <menuchoice>Code</menuchoice> and <menuchoice>Debug</menuchoice> as you can see in the top right corner of the '''KDevelop''' main window. The picture on the right shows you how this looks. In <menuchoice>Review</menuchoice> mode, the top part shows you diffs for the entire subdirectory/project and each individual changed file with changes highlighted (see the various tabs on this part of the window). By default, all changed files are in the changeset you are about to commit, but you can unselect some of the files if their modifications are unrelated to what you want to commit. For example, in the example on the right I have unselected <code>step-32.cc</code> and <code>step-32.prm</code> because the changes in these files have nothing to do with the other ones I made to this project and I don't yet want to check them in yet (I may later want to do so in a separate commit). After reviewing the changes you can enter a commit message into the text box and hit <menuchoice>Commit</menuchoice> on the right to send things off.
 
<!--T:10-->
* As with seeing differences, if you want to check in a single file you can also just right click into the editor window to get the <menuchoice>Subversion -> Commit</menuchoice> menu item.


* If you want to check in one or more edited files, right click either on an individual file, subdirectory, or whole project and select <menuchoice>Subversion > Commit</menuchoice>. This will get you into "Review" mode, the third mode besides "Code" and "Debug" as you can see in the top right corner of the KDevelop main window. The picture on the right shows you how this looks. In review mode, the top part shows you diffs for the entire subdirectory/project and each individual changed file with changes highlighted (see the various tabs on this part of the window). By default, all changed files are in the changeset you are about to commit, but you can unselect some of the files if their modifications are unrelated to what you want to commit. For example, in the example on the right I have unselected <code>step-32.cc</code> and <code>step-32.prm</code> because the changes in these files have nothing to do with the other ones I made to this project and I don't yet want to check them in yet (I may later want to do so in a separate commit). After reviewing the changes you can enter a commit message into the text box and hit "Commit" on the right to send things off.


* As with seeing differences, if you want to check in a single file you can also just right click into the editor window to get the <menuchoice>Subversion > Commit</menuchoice> menu item.
<!--T:11-->
{{Prevnext2
| prevpage=Special:MyLanguage/KDevelop4/Manual/Debugging_programs | nextpage=Special:MyLanguage/KDevelop4/Manual/Customizing KDevelop
| prevtext=Debugging programs | nexttext=Customizing KDevelop
| index=Special:MyLanguage/KDevelop4/Manual | indextext=Back to menu
}}


<!--T:12-->
[[Category:Development]]
[[Category:Development]]
</translate>

Latest revision as of 07:05, 24 May 2011

Other languages:

Working with version control systems

If you are working with larger projects, chances are that the source code is managed by a version control system such as subversion or git. The following description is written with subversion in view but will be equally true if you use git or any other supported version control system.

First not that if the directory in which a project is located is under version control, KDevelop will automatically notice. In other words: It is not necessary that you tell KDevelop to check out a copy itself when setting up your project; it is ok to point KDevelop at a directory into which you have previously checked out a copy from the repository. If you have such a directory under version control, open the Projects tool view. There are then a number of things you can do:

  • If your directory has become outdated, you can update it from the repository: Click on the project name with the right mouse button, go to the menu Subversion and select Update. This will bring all files that belong to this project up to date with respect to the repository.
  • If you want to restrict this action to individual subdirectories or files, then expand the tree view of this project to the level you want and right click on a subdirectory or file name, then do the same as above.
  • If you've edited one or more files, expand the view of this project to the directory in which these files are located and right click on the directory. This gives you a menu item Subversion that offers you different choices. Choose Compare to base to see the differences between the version you have edited and the version in the repository you had previously checked out (the revision "base"). The resulting view will show the "diffs" for all files in this directory.
  • If you only edited a single file, you can also get the Subversion menu for this file by simply right clicking on the corresponding file name in the project view. Even simpler, just right clicking into the Editor view in which you have opened this file will also give you this menu option.
  • If you want to check in one or more edited files, right click either on an individual file, subdirectory, or whole project and select Subversion -> Commit. This will get you into Review mode, the third mode besides Code and Debug as you can see in the top right corner of the KDevelop main window. The picture on the right shows you how this looks. In Review mode, the top part shows you diffs for the entire subdirectory/project and each individual changed file with changes highlighted (see the various tabs on this part of the window). By default, all changed files are in the changeset you are about to commit, but you can unselect some of the files if their modifications are unrelated to what you want to commit. For example, in the example on the right I have unselected step-32.cc and step-32.prm because the changes in these files have nothing to do with the other ones I made to this project and I don't yet want to check them in yet (I may later want to do so in a separate commit). After reviewing the changes you can enter a commit message into the text box and hit Commit on the right to send things off.
  • As with seeing differences, if you want to check in a single file you can also just right click into the editor window to get the Subversion -> Commit menu item.