日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

SVN专题(Visual SVN Server + TortoiseSVN + Visual SVN)

發(fā)布時間:2024/4/17 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SVN专题(Visual SVN Server + TortoiseSVN + Visual SVN) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

參考資料:

1、Windows環(huán)境下搭建SVN服務(wù)器。原文地址:https://blog.csdn.net/lu1024188315/article/details/74082227

2、Git|SVN學(xué)習(xí)目錄:https://blog.csdn.net/lu1024188315/article/details/74080006

3、搭建SVN服務(wù)器詳細教程:https://blog.csdn.net/daobantutu/article/details/60467185

4、VisualSVN Server提交前必須寫信息(備注):https://blog.csdn.net/zyf_balance/article/details/51332056

5、svn 服務(wù)器設(shè)置,提交時強制注釋(Windows版):https://blog.csdn.net/feihu_guest/article/details/39499063

?

?

下載地址

VisualSVN Server(免費)

http://www.visualsvn.com/server/download/

TortoiseSVN

http://tortoisesvn.net/downloads.html

Visual SVN(VS插件)

?

Eclipse SVN插件

官方下載:?http://www.eclipse.org/subversive/downloads.php

=======================================

一、Visual的安裝和使用

1 VisualSVN Server安裝

【1 】幾乎都是下一步。

【2】 選擇?visualVSN服務(wù)器和管理控制臺?或只有管理控制權(quán)限

【3】選擇程序安裝的路徑、Subversion Repository(庫)的路徑和所使用的協(xié)議和端口。

?

【4】接著就是復(fù)制文件的過程。

【5】安裝完成后會詢問你是否需要運行VisualSVN Server Manager(一個非常有用的管理工具)

【6 】打開“ VisualSVN Server Manager ”,如下:

?

二、 創(chuàng)建版本庫

修改URL:

查看IP命令:

下面我示范添加一個代碼庫【Repository】,如下圖:

點擊Repository右鍵

按上圖所示,創(chuàng)建新的代碼庫,在下圖所示的文本框中輸入代碼庫名稱:

【注】上圖中的CheckBox如果選中,則在代碼庫StartKit下面會創(chuàng)建trunk、branches、tags三個子目錄;不選中,則只創(chuàng)建空的代碼庫StartKit。

點擊OK按鈕,代碼庫就創(chuàng)建成功了。

創(chuàng)建完代碼庫后,沒有任何內(nèi)容在里面

下面,我們開始安全性設(shè)置,在左側(cè)的Users上點擊右鍵:

輸入上面的信息,點擊OK,我們就創(chuàng)建一個用戶了。按照上面的過程,分別添加用戶其他用戶就可以了。

下面我們開始添加這些用戶到我們剛才創(chuàng)建的項目里。

點擊剛才創(chuàng)建的庫,Lenovo,右擊選擇屬性(Properties)

點擊上圖中的"Add..."按鈕,在下圖中選擇我們剛才添加的用戶,

注意這里的權(quán)限設(shè)置,要選擇好。

點擊"確定"按鈕,上面的用戶就具有了訪問StartKit代碼庫的不同權(quán)限。

=======================================

三、檢出項目和上傳代碼

3.1 檢出項目(以lenovo項目為例)

創(chuàng)建版本庫lenovo,右鍵點擊lenovo文件夾,選擇copy URL toCLipboard,就是復(fù)制統(tǒng)一資源定位符(URL)到剪貼板中

?

在電腦空白處單擊右鍵,選擇SVN檢出(SVN Checkout...)

?

之后彈出對話框,將剛出的地址粘貼到第一個地址欄中

再選擇導(dǎo)出目錄,點擊確定。會彈出輸入用戶名和密碼的對話框,而且會在你選擇的導(dǎo)出目錄處新建一個lenovo文件夾。

輸入剛才創(chuàng)建的用戶名和密碼。確定,然后會彈出檢出界面。

=======================================

3.2上傳文件到SVN

將要上傳的文件放到導(dǎo)出目錄中, 右鍵TortoriseSVN—Add,再右鍵提交

選擇后彈出提交對話框

?

四、VisualSVN Server提交前必須寫信息(備注)

Visual SVN?Server下 右鍵項目??“所有任務(wù)”》“Manage?Hooks”?》選中Pre-commit?hook然后edit編輯,添加如下代碼

?@echo off

:: ? ?
:: Stops commits that have empty log messages.
::

@echo off

setlocal
rem Subversion sends through the path to the repository and transaction id
set REPOS=%1
set TXN=%2

rem check for an empty log message
svnlook log %REPOS% -t %TXN% | findstr . > nul
if %errorlevel% gtr 0 (goto err) else exit 0

:err
echo. 1>&2
echo 信息(備注)不允許為空,請?zhí)顚懶畔⑷缓笾卦?1>&2

exit 1

?

?在SVN的Repositories路徑中:?Repositories\RedAndGreen\hooks?? ? 創(chuàng)建pre-commit.bat批處理文件,內(nèi)容如下:

?

@echo off
rem SVN強制寫注釋的hooks腳本(Windows)
rem 文件名是: pre-commit.bat,放到repository/hooks目錄下
setlocal
set SVN_BINDIR="C:\Program Files\VisualSVN Server\bin"
set REPOS=%1
set TXN=%2

rem check that logmessage contains at least 10 characters
rem .....代表5個字符
%SVN_BINDIR%\svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul

if %errorlevel% gtr 0 goto err
exit 0

:err
echo [Commit failed]: Empty log message not allowed. 1>&2
exit 1

?

五、SVN常用操作

一、由于Unity打包過程需要耗費很長的時間,在測試過程中如果只需測某幾種功能,則我們大可以需要將某些Resources中的資源刪除,以節(jié)約打包時間. 但是當(dāng)你刪除之后,問題來了,每次更新SVN都會把這些刪除了的資源重新更新下來,再此編譯,又要耗費很長時間。 如果我們更新的時候能讓SVN不更新這部分資源就好了,可惜的是TortoiseSVN就有這功能。 將資源排除在SVN控制之內(nèi): 右鍵單擊文件夾 -> TortoiseSVN -> Unversion and add to ignore list -> 文件夾名稱 將資源重新納入至SVN控制: 如果你要重新納入的文件已經(jīng)在本地不存在,那么你可以從SVN上重新Checkout一份. 但重新Checkout下來的文件夾仍然沒有納入到SVN控制中。 右鍵單擊該文件夾 -> TortoiseSVN -> Clean up -> 在彈出的對話中統(tǒng)統(tǒng)都打勾 -> 再次Update? 二、服務(wù)器換了新的IP地址,這時候我們之前下載下來的SVN項目就需要重新鏈接至最新的IP地址。 解決步驟:

重新定義SVN的URL,右鍵(TortoiseSVN)?→?Relocate?→?輸入你新的IP地址

?

六、SVN常用圖片及含義

原文地址:http://blog.csdn.net/xh16319/article/details/10582455

綠色的勾:圖標表示這是一個最新取出的工作副本,他的Subversion狀態(tài)是normal。

灰色的勾:灰色圖標表示”只讀”,如果你給一個文件設(shè)置了svn:needs-lock屬性,Subversion會讓此文件只讀,直到你獲得文件鎖。只讀文件具有這個重載圖標來表示你必須在編輯之前先得到一個鎖。

紅色感嘆號:當(dāng)你開始編輯一個文件,這個文件的狀態(tài)就會變成modified,圖標也會變成紅色圓圈帶一個感嘆號。這樣你就可以輕易的知道自從上次更新以來都有修改過哪些文件,需要提交哪些文件。

黃色感嘆號:三角符號帶感嘆號,表示在一次update中產(chǎn)生了一個沖突(conflict)。

藍色加號:意味著這個文件或文件夾已經(jīng)被計劃加入到版本控制之下。

紅叉叉:表示相應(yīng)文件或文件夾被計劃刪除(deleted),或者表示文件缺失。

灰色一行:表示不受版本控制,忽略版本控制。

藍色問號:暫時還沒收到版本的控制,但是沒有被忽略。

鎖扣:表示文件被鎖定,他的Subversion狀態(tài)是normal,必須先釋放鎖才能讓別人的更改提交。

?

?

?

SVN圖標無法正常顯示問題解析:
1.在Myeclipse或者Eclipse中使用SVN插件作為版本控制器,一直以來都是正常使用的。但是突然喲一天,project下的files的版本號和提示圖標都不見了,經(jīng)過檢查SVN是正常的。
開始的時候是把wrokspace下的.metadata刪除,然后重新將project導(dǎo)入workspace下,即可正常使用。
但是現(xiàn)在發(fā)現(xiàn)一種更為方便的方法:
進入 到:windows->preferences->General->Appearance->LableDecorations勾選其中的SVN項即可?;蛘?#xff0c;還可以打開windows->preferences->Team->SVN中做相關(guān)設(shè)置。

2.最近更新了SVN軟件,更新后發(fā)現(xiàn),同步文件夾沒有打?qū)吹臉擞?#xff0c;網(wǎng)上都說檢查SVN設(shè)置:
右鍵->TSVN->設(shè)置->樣式->重疊圖標->Statuscache
里面有三個選項:
1Default
2Shell
3None
如果是前面兩個,應(yīng)該就有svn圖標,如果是none,就沒有。
但都解決不了問題,后來用安裝文件的修復(fù)功能解決了此問題,即雙擊安裝文件,選修復(fù),之后重啟系統(tǒng)就可以了。這似乎是SVN更新后的普遍問題。

?

?

?

?

  • 項目視圖? ?The Package Explorer view

?

- 已忽略版本控制的文件。可以通過Window → Preferences → Team → Ignored Resources.來忽略文件。
A file ignored by version control. You can control what resources will be ignored by going to Window → Preferences → Team → Ignored Resources.

?-?未納入版本控制的文件,一般是新增,尚未提交的文件。
A file not under version control. These are typically new files that you have not committed to the repository yet.

- 本地重命名或移動到其它目錄的文件。
A versioned file that needs to be added to the remote repository. These are typically files you have either renamed, or moved to a different directory.

- 本地刪除的目錄。
A deleted folder. These are folders that you have deleted locally without yet committing the changes to the repository. Note that files are usually removed from the view when they're deleted locally, so they are normally not seen with this icon.

- 沒有任何改動的文件。
A file with no local changes.

- 發(fā)生改動,尚未提交的文件。
A file with local, uncommitted changes.

- 處于鎖定狀態(tài)的文件。
A locked file.

- 有沖突沒有解決,就更新或提交的文件。
A conflicted file. These are typically files that had a commit/update conflict that you marked to resolve later.

?- 有目錄樹沖突的文件。一般在最近一次更新后,資源庫上的文件被移動、刪除或重命名。
A file that has a tree conflict. These are typically files that have local changes, but have since been moved, removed, or renamed in the repository since the last local copy update.

-? 引用外部項目的文件,不能提交到本項目的資源庫里。
A file that is external to the project. Linked external files cannot be committed to the repository.

- 有分支版本的文件。這些文件屬于另外一個不同的工作目錄而不是屬于本地的父目錄。
A file that has been switched. These are files which belongs to a different working copy than their local parent directory.

?

  • 遷出 Outgoing view

?

- 本地有更改的文件。
A file whose contents have been modified and will be committed to the repository.

- 本地新增的文件。
?A file that will be newly added to the repository. This may coincide with a file removal in cases where a file is moved or renamed..

- 本地刪除的文件。
A file that will be removed from the repository. This may coincide with a file addition in cases where a file is moved or renamed.

- 本地文件屬性發(fā)生變化了的文件。
A file with property changes, in the Commit dialog. On the Synchronize tab, property changes are currently reflected as a normal file modification ().

?

  • 遷入 Incoming view

?

- 需要更新的文件。?
A file that has content changes committed to the repository that will be applied to the local copy.

- 需要遷入的新增文件。
A new file that will be added to the local copy from the repository. Like the outgoing file addition, this may be the result of a move or rename.

- 資源庫中刪除了的文件。
A file that will be removed from the local copy because it has been removed from the repository. Like the outgoing file removal, this may be the result of a move or rename.

?

  • 沖突 Conflict view

?

- 資源庫和本地同時有修改的文件。
A file that has been changed in both the local copy and repository independently, causing a need for conflict resolution. Fixing this condition involves opening up the conflict view or forcibly overwriting changes locally or remotely.

- 遠程資源庫上已經(jīng)被重命名或移動、刪除的文件。?
A file that has a tree conflict. This can occur when there are new changes to a file on one end (either local or remote), and the file is moved, removed, or renamed on the other.

?

  • “與資源庫同步”選項打開的界面上的一些按鈕 Others :

?

Finally, the Synchronize with Repository option opens the Synchronize tab () with the following buttons:
?
- 同步選中的文件,下拉箭頭切換不同的遠程目錄。
Synchronizes the local copy with the currently selected repository when clicked. Selecting from the drop-down allows switching between different remote code bases.

- 只顯示需要遷入的文件。

Shows only incoming changes (remote → local).

?- 只顯示需要提交的文件。

Shows only outgoing changes (local → remote).

- 同時顯示需要更新或提交文件。

Shows both incoming and outgoing changes (remote ? local).

- 只顯示有沖突的文件。

Shows conflicting changes.

- 更新全部文件。

Updates all local resources with incoming changes after prompt.

- 提交全部文件。

Brings up the commit dialog to commit all outgoing changes.

?

七、SVN常見問題及解決方法

7.1svn狀態(tài)圖標不顯示

Windows最多只允許15個覆蓋圖標,它自己又用了幾個,結(jié)果給用戶用的就11個左右了,如果你安裝了其他網(wǎng)盤,那可用的就更少了。

解決方法:

1、在運行里輸入regedit進入注冊表

2、依次打開HKEY_LOCAL_MACHINE->SOFTWARE->Microsoft->Windows->CurrentVersion->Explorer->ShellIconOverlayIdentifiers,會發(fā)現(xiàn)Tortoise前綴的一些文件,選中右鍵重命名,在前面加個空格就可以排到最前面了,如下圖:

3、這時圖標還是沒有出來,需要重啟下explorer.exe進程,在任務(wù)管理器的進程里找到explorer.exe,結(jié)束進程,然后 文件>新建任務(wù)(運行...),輸入explorer.exe,圖標就會顯示出來了,如下圖:

7.2、svn報錯can only be performed on a version resource [at this time].

https://www.cnblogs.com/pangguoming/p/7298749.html

?

7.3、svn:Checksum mismatch while updating

https://blog.csdn.net/a342500329a/article/details/73106267

?

7.4、eclipse中svn提交顯示錯誤svn: E200007: CHECKOUT can only be performed on a version resource

https://blog.csdn.net/u011476390/article/details/78623572

轉(zhuǎn)載于:https://www.cnblogs.com/cheng2015/p/9022829.html

與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的SVN专题(Visual SVN Server + TortoiseSVN + Visual SVN)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。