Contents
Using Version Control SystemsVersion control systems supported by Qt Creator are:
Setting Up Version Control SystemsQt Creator uses the version control system's command line clients to access your repositories. To allow access, make sure that the command line clients can be located using the PATH environment variable or specify the path to the command line client executables in Tools > Options... > Version Control. After you set up the version control system, use the command line to check that everything works (for example, use the status command). If no issues arise, you should be ready to use the system also from Qt Creator. Setting Up Common OptionsSelect Tools > Options... > Version Control > Common to specify settings for submit messages:
The fields above appear below the submit message. They provide completion for the aliases/public user names specified in the User/alias configuration file as well as a button that opens the aforementioned user name dialog. Creating VCS Repositories for New ProjectsQt Creator allows for creating VCS repositories for version control systems that support local repository creation, such as Git or Mercurial. When creating a new project by selecting File > New File or Project..., you can choose a version control system in the final wizard page. Using Version Control SystemsThe Tools menu contains a sub-menu for each supported version control system. The Version Control output pane displays the commands that are executed, a timestamp, and the relevant output. Select Window > Output Panes > Version Control to open the pane. Adding FilesWhen you create a new file or a new project, the wizard displays a page asking whether the files should be added to a version control system. This happens when the parent directory or the project is already under version control and the system supports the concept of adding files, for example, Perforce and Subversion. Alternatively, you can add files later by using the version control tool menus. With Git, there is no concept of adding files. Instead, all modified files must be staged for a commit. Viewing Diff OutputAll version control systems provide menu options to diff the current file or project: to compare it with the latest version stored in the repository and to display the differences. In Qt Creator, a diff is displayed in a read-only editor. If the file is accessible, you can double-click on a selected diff chunk and Qt Creator opens an editor displaying the file, scrolled to the line in question. Viewing Versioning History and Change DetailsDisplay the versioning history of a file by selecting Log (for Git and Mercurial) or Filelog (for CVS, Perforce, and Subversion). Typically, the log output contains the date, the commit message, and a change or revision identifier. Click on the identifier to display a description of the change including the diff. Right-clicking on an identifier brings up a context menu that lets you show annotation views of previous versions (see Annotating Files). Annotating FilesAnnotation views are obtained by selecting Annotate or Blame. Selecting Annotate or Blame displays the lines of the file prepended by the change identifier they originate from. Clicking on the change identifier shows a detailed description of the change. To show the annotation of a previous version, right-click on the version identifier at the beginning of a line and choose one of the revisions shown at the bottom of the context menu. This allows you to navigate through the history of the file and obtain previous versions of it. It also works for Git and Mercurial using SHA's. The same context menu is available when right-clicking on a version identifier in the file log view of a single file. Committing ChangesOnce you have finished making changes, submit them to the version control system by choosing Commit or Submit. Qt Creator displays a commit page containing a text editor where you can enter your commit message and a checkable list of modified files to be included. When you have finished filling out the commit page information, click on Commit to start committing. The Diff Selected Files button brings up a diff view of the files selected in the file list. Since the commit page is just another editor, you can go back to it by closing the diff view. You can also check a diff view from the editor combo box showing the Opened files. Reverting ChangesTo discard local changes to a file or project, use the Revert function or the Undo Changes/Undo Repository Changes function (for Git). The changes discarded depend on the version control system. For example, in Perforce, select Revert File/Revert Project to discard changes made to open files, reverting them to the revisions last synchronized from the repository. Select Revert Unchanged to revert files if their contents or file type have not changed after they were opened for editing. Using Additional Git FunctionsThe Git sub-menu contains the following additional items:
Using Additional Mercurial FunctionsThe Mercurial sub-menu contains the following additional items:
Using Additional Perforce FunctionsWhen you start Qt Creator, it looks for the executable specified in the P4 command field in Tools > Options... > Version Control > Perforce. If you do not use Perforce and want to turn off the check, clear this field. The Perforce sub-menu contains the following additional items:
Using Additional Subversion FunctionsThe Subversion sub-menu contains the following additional items:
[Previous: Using the Maemo Emulator] [Next: Getting Help] X
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |