smartsvn學習(-)


3. Day-to-day use

3.1 Everyday commands

Most of the common commands you will need are in the SmartSVN toolbar:

3.1.3 Add

使用Add來添加新的文件和文件夾。如果文件夾下面還有其他的子文件夾頁可以一起提交。

Use Add to schedule files or directories to add to your repository. If you're adding a directory you have the option to Recurse into subdirectories, which, when selected, causes all subdirectories and files from subdirectories to be added too.

3.1.4 Remove

Use this to schedule the removal of files or directories from your repository.

Select Remove from SVN control and delete locally to schedule the files or directory for removal and to also delete them locally. Select Just remove from SVN control to schedule for removal only. After committing the changes, the files or directories remain unversioned.

By default, SmartSVN refuses to remove files or directories that have local modifications, as well as directories that contain modified or unversioned files. Select Force Removal (ignore local modifications, etc.) if you want to remove these items anyway.

 

3.1.5 Move

使用這個move的命令來move 並且/或者 重命名一個文件或者文件夾。新的文件和文件夾會被添加舊的會被移除但是會保留移除紀錄。

Use this to move and/or rename a file or directory that is already under SVN control. The file with the old name will be scheduled for removal, and the file with the new name scheduled for addition. This command preserves the history of the moved item.

3.1.6 Revert

用來恢復本地對文件和文件夾的修改。

Use this to revert the local changes of the selected files or directories. For directories, you can Revert Recursively, i.e. to recurse into subdirectories. If deselected, only the properties of the directory itself are reverted.

Be careful before reverting a file or directory because all local modifications will be lost.

  • Added and copied files/directories are unscheduled for addition and returned to unversioned state.
  • Removed files/directories are unscheduled for removal and restored with their content and properties taken from the pristine copy.
  • Replaced files/directories are unscheduled for replacement and restored with their content and properties taken from the pristine copy.
  • Modified files/directories are restored with their content and properties taken from the pristine copy (overwriting local changes!).
  • Missing files are restored with their content and properties taken from the pristine copy. Missing directories cannot be restored, because the pristine copy is also missing. You'll need to update your working copy instead.
  • Conflicted files/directories are restored with their content and properties taken from the pristine copy, ignoring local changes which caused the conflict.
  • For Case-changed files their original file names are restored and modifications in contents/properties are reverted.

3.1.7 Delete

使用這個來刪除本地文件或者沒有版本控制或者被忽略的文件夾。一定要小心因為無法還原沒有版本控制的文件。

Use this to delete local files, or unversioned or ignored directories. 

Be careful before deleting a file or directory because you cannot recover unversioned items.

3.1.8 Fix

使用這個命令來確定或者修復選擇的文件或者文件夾。這個選項是很少用的。

Use this to fix or 'repair' the selected directory or files. This option is only applicable for certain, unusual working copy states:

Case-changed files

SVN repositories and working copies are generally case-sensitive. This can cause problems when working on a case-insensitive operating system, like Microsoft Windows or some file systems on Apple Mac OS, and changing the file name's case (upper-case to lower-case, etc.). Because of SVN's working copy format and the pristine copies, it's technically not possible to handle such a file name case change.

One solution is to avoid this situation by either only performing file name case changes on an operating system which supports case-sensitive file names, or directly in the repository by using the Repository Browser.

However, a file name case change can happen on a case-insensitive operating system, e.g. because of defect software tools, etc. SmartSVN detects such invalid changes and puts the file into a case-changed file state, see Rare Primary File States. Fix now changes the file name case back to its original form as found within the pristine copy, resolving this problem.

Nested roots

A nested root (see Primary Directory States) is a working copy within another working copy which is not related to this parent working copy. SVN commands ignore such nested roots. They are treated as unversioned directories.

Nested roots typically result from moving a directory from one location to another without using the proper SVN commands, like Move. This leaves a missing directory at its original location and introduces a nested root at its current location.

Fix offers the following solutions for nested roots, depending on their origin:

  • Mark as Copied converts the nested root to a copied directory, with its copy location being the original repository location. This option is only available if the current location is part of the same repository as the original location.
  • Convert to Unversioned strips off the working copy metadata (.svn directories) for this directory and all of its children. This makes the directory unversioned, so it can be added and committed afterwards. This option is always available but, in general, should only be used if Mark as Copied is not available, because unversioned directories can be added afterwards, though their history is lost.

Added-missing directories

當添加一個文件夾后又在本地刪除了,(倉庫和他的.svn子目錄就missing了),文件夾就會處在Added-missing的狀態。

If a directory has been scheduled for addition and has been locally deleted afterwards (i.e. the directory and its .svn subdirectory are missing), the directory is in Added-missing state.

Such directories are actually only a leftover entry in the parent directory's metadata directory (.svn). The resolution is to Revert them, which is what this command does.

 

3.1.9 Changes

changes可以展示出本地修改文件和遠程文件不同的地方,雙擊本地文件也可以打開查看不同的地方

Changes shows you the difference between locally modified files and the pristine copy. From there you have several options:

  • Refresh: refresh the file contents from the file system and recalculate the differences.
  • Previous Change: navigate to the previous change within the currently selected file.
  • Next Change: navigate to the next change within the currently selected file.
  • Ignore Whitespace for Line Comparison: when selected, two lines are treated as equal, if they only differ in the number, but not in the position of whitespaces.
  • Take Left: overwrite the local file changes with the content of the pristine copy.
  • Take Right: overwrite the pristine copy with the local file changes.

When you're happy with any changes made, click Save.

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM