SVN鍒嗘敮鐨勫悎骞跺拰鍚屾
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SVN鍒嗘敮鐨勫悎骞跺拰鍚屾相关的知识,希望对你有一定的参考价值。
鏍囩锛?/p>
浣跨敤svn鍑犲勾浜嗭紝涓€鐩村鍒嗘敮鍜屽悎骞舵暚鑰岃繙涔嬶紝涓€鏉ユ槸鍥犱负鍒嗘敮鐨勭鐞嗕笉璇ユ垜鎿嶅績锛屼簩鏉ュ嵆浣挎秹鍙婂埌鍒嗘敮鐨勭鐞嗭紝涔熶笉鏁㈣锤鐒朵娇鐢ㄥ悎骞跺姛鑳斤紝鐢熸€曞悎骞跺嚭浜嗛棶棰樺鍥㈤槦閫犳垚涓嶈壇褰卞搷锛屾渶涓昏鐨勫師鍥犳槸锛岃嚜宸卞鍒嗘敮鐨勭洰鐨勫拰鍚堝苟鐨勬柟娉曚笉鐢氫簡瑙o紝杩欐墠鏄‖浼ゃ€?/p>
鏈€杩戠敱浜庨€傞厤鏈哄瀷鐨勯渶瑕侊紙鏈汉浠庝簨鎵嬫満瀹㈡埛绔殑寮€鍙戯級锛岄渶瑕佺粡甯告帴瑙﹀垎鏀拰鍚堝苟涓ら」宸ヤ綔锛岀獊鐒跺彂鐜拌繖鐜╂剰鏁翠笉鏄庣櫧寰堥毦寮€灞曞伐浣滐紝閬傝繖涓ゅぉ鐫€閲嶇爺绌朵簡涓€涓嬶紝鏈夌偣鏀惰幏锛屾€曚互鍚庡繕浜嗭紝鏁呰秮鐫€浣欐俯灏氬湪璧剁揣鍐欎笅鏉ワ紝濂借鎬т笉濡傜儌绗斿ご鍢涖€備笅鏂囩殑瀹炶返涓昏鏄弬鑰冧簡TortoiseSVN鐨勫府鍔╂枃妗e拰Subversion鐨勫湪绾挎枃妗o紝Subversion鐨勫湪绾挎枃妗o細http://svnbook.red-bean.com/en/1.5/svn-book.html
璇濊鎴戝叕鍙哥幇鍦ㄧ殑婧愪唬鐮佺鐞嗘尯涔辩殑锛宻vn鐩綍骞舵病鏈夐噰鍙栨爣鍑嗙殑source/branches銆乻ource/trunk缁撴瀯锛屼富绾垮拰鍒嗘敮鏀惧緱鍒板閮芥槸锛宺elease鐗堟湰涔熷苟娌℃湁褰撴垚tag澶勭悊锛岃€屾槸褰撴垚branch鏉ョ鐞嗭紝缁忓父杩樿鍦╮elease鐗堟湰涓婃敼鏉ユ敼鍘汇€傘€傘€?/p>
鍏堣璇翠粈涔堟槸branch銆傛寜鐓ubversion鐨勮娉曪紝涓€涓猙ranch鏄煇涓猟evelopment line锛堥€氬父鏄富绾夸篃鍗硉runk锛夌殑涓€涓嫹璐濓紝瑙佷笅鍥撅細
branch瀛樺湪鐨勬剰涔夊湪浜庯紝鍦ㄤ笉骞叉壈trunk鐨勬儏鍐典笅锛屽拰trunk骞惰寮€鍙戯紝寰呭紑鍙戠粨鏉熷悗鍚堝苟鍥瀟runk涓紝鍦╞ranch鍜宼runk鍚勮嚜寮€鍙戠殑杩囩▼涓紝浠栦滑閮藉彲浠ヤ笉鏂湴鎻愪氦鑷繁鐨勪慨鏀癸紝浠庤€屼娇寰楁瘡娆′慨鏀瑰湪repository涓兘鏈夎褰曘€?/p>
璁炬兂浠ヤ笅鍦烘櫙锛屽鏋滀綘鐨勯」鐩渶瑕佸紑鍙戜竴涓柊鍔熻兘锛岃€岃鍔熻兘鍙兘浼氫慨鏀归」鐩腑鐨勭粷澶у鏁版枃浠讹紝鑰屼笌姝ゅ悓鏃讹紝浣犵殑鍙︿竴浣嶅悓浜嬫鍦ㄨ繘琛宐ug fix锛屽鏋滀綘鐨勬柊鍔熻兘涓嶅湪branch涓紑鍙戣€岀洿鎺ュ湪trunk涓紑鍙戯紝閭d箞浣犳瀬鏈夊彲鑳藉奖鍝嶅彟涓€浣嶅悓浜嬬殑bug fix锛屼粬/濂瑰湪bug淇涓彲鑳戒細閬囧埌鍚勭鍚勬牱鐨勯棶棰橈紝鍥犱负浣犵殑棰戠箒鎻愪氦浠g爜寮曞叆浜嗚繃澶氱殑涓嶇ǔ瀹氬洜绱犮€備綘鍙兘浼氳锛岄偅鎴戝湪寮€鍙戠殑杩囩▼涓笉鎻愪氦涓嶅氨琛屼簡锛岀瓑鍒版垜鍏ㄩ儴寮€鍙戠粨鏉熸垜鍐嶆彁浜わ紝鏄紝浣犲彲浠ヨ繖涔堝仛锛岄偅杩樿鐗堟湰鎺у埗骞蹭粈涔堝憿锛熶篃璁哥瓑鍒颁綘鏈€鍚庢彁浜や唬鐮佺殑鏃跺€欙紙涔熻涓€鍛紝涔熻涓ゅ懆锛燂級锛屼綘浼氬彂鐜版湁涓€澶у爢conflict绛夌潃浣爎esolve銆傘€傘€?/p>
閭d箞锛屾纭殑鍋氭硶鏄粈涔堬紵浣跨敤branch锛屼粠trunk鍒涘缓branch锛岀劧鍚庡湪浣犵殑branch涓婂紑鍙戯紝寮€鍙戝畬鎴愬悗鍐嶅悎骞跺埌trunk涓€?/p>
鍏充簬branch鍏堣鍒拌繖閲岋紝涓嬮潰璇磋浠€涔堝彨鍋氬悎骞躲€傚緢濂界悊瑙o紝褰揵ranch寮€鍙戝畬鎴愬悗锛堝寘鎷繀瑕佺殑娴嬭瘯锛夛紝灏哹ranch涓殑淇敼鍚屾鍒皌runk涓紝杩欎釜杩囩▼鏈夊彲鑳藉寘鎷慨鏀规枃浠躲€佸鍔犳枃浠躲€佸垹闄ゆ枃浠剁瓑绛夈€?/p>
璇村埌杩欓噷锛岃矊浼兼湰鏂囧樊涓嶅鍙互缁撴潫浜嗭紝涓嶅氨鏄垎鏀拰鍚堝苟涔堬紵鍙鍐嶇畝鍗曞湴璇磋濡備綍寤虹珛鍒嗘敮鍜屽浣曞悎骞跺氨鍙互鏀跺熬浜嗭紝鍙兘鍙渶涓や釜鍛戒护锛屼篃鍙兘鍙渶榧犳爣鐐瑰嚑涓嬬劧鍚庨敭鐩樻暡涓や笅鍗冲彲銆傚叾瀹炰簨鎯呰繙闈炶繖涔堢畝鍗曪紝鐖卞姩鑴戠瓔鐨勫悓瀛﹀彲鑳戒細闂簡锛屽皢branch鐨勬敼鍔╩erge鍒皌runk鐨勬椂鍊欙紝鍜屼笂鏂囪鐨勭洿鎺ュ湪trunk涓叏閮ㄥ紑鍙戝畬鐒跺悗鎻愪氦鏈変綍鍖哄埆锛熶綘鏈€鍚庤繕涓嶆槸瑕佸鐞嗕竴澶у爢conflict锛?/p>
杩欎釜闂闂緱闈炲父濂斤紝鍏跺疄杩欐鏄湰鏂囩殑閲嶇偣锛歜ranch鍜宼runk鍦ㄥ苟琛屽紑鍙戠殑杩囩▼涓浣曟劅鐭ュ鏂癸紝branch濡備綍鎵嶈兘鍦ㄥ紑鍙戣繃绋嬩腑涓嶄細鍜宼runk瓒婅蛋瓒婅繙锛屽鑷存渶鍚庢棤娉曞悎骞讹紵璇曟兂涓€涓嬶紝濡傛灉鍦ㄤ綘寮€鍙慴ranch鐨勮繃绋嬩腑锛宼runk涓殑鏌愪釜绫绘枃浠跺凡缁忚鍒犻櫎浜嗭紙杩欏彲鑳芥槸鍙﹀涓€涓浼欏湪鍙︿竴涓猙ranch涓婂紑鍙戜簡涓ゅ懆鍚庢墠鍚堝苟鍒皌runk鐨勶級锛岃€屼綘绔熺劧鍦ㄨ繖涓被鏂囦欢涓婂仛浜嗗ぇ閲忎慨鏀癸紝璇曢棶浣犲埌鏈€鍚庡悎骞跺洖trunk鐨勬椂鍊欒鏈夊铔嬬柤锛熻В鍐宠繖涓€闂鐨勫敮涓€鎵嬫鏄紝branch瑕佷笉鍋滃湴鍜宼runk淇濇寔鍚屾锛屼綘瑕佸強鏃跺湴鐭ラ亾trunk閮藉仛浜嗕粈涔堜慨鏀癸紝杩欎簺淇敼鏄惁浼氬奖鍝嶄綘姝e湪寮€鍙戠殑鏂板姛鑳斤紝濡傛灉闇€瑕侊紝浣犲繀椤诲強鏃惰皟鏁碽ranch鐨勪唬鐮侊紝浣夸箣鑳戒笌trunk“鍏煎”銆?/p>
閭d箞濡備綍璁゜ranch鍜宼runk淇濇寔鍚屾锛熷悎骞讹紝浠巘runk鍚堝苟鍒癰ranch锛屼綘娌″惉閿欙紝鏄粠trunk鍚堝苟鍒癰ranch銆傚叧浜嶵ortoiseSVN鐨勫悎骞讹紝鏈夊嚑鐐归渶瑕佹敞鎰忥細
- TortoiseSVN鐨勫悎骞跺彂鐢熷湪鏈湴锛屼篃鍗充綘鐨剋orking copy涓紝浣犳棤闇€杩囧鎷呭績浼氬repository涓殑浠g爜閫犳垚褰卞搷
- 涓嶇鏄粠trunk鍚堝苟鍒癰ranch杩樻槸鏈€缁堜粠branch鍚堝苟鍥瀟runk锛屽湪姣忔鍚堝苟鍓嶆渶濂藉厛update锛岀劧鍚庡皢鏈湴鐨勪慨鏀瑰厛鍏ㄩ儴commit锛屼繚鎶ゅソ鐜板満锛屼竾涓€鍚堝苟涓嶇悊鎯抽殢鏃堕兘鍙互revert
- 鍚堝苟瀹屾垚鍚庣湅鏄惁鑳芥纭紪璇戯紝鐒跺悗娴嬭瘯楠岃瘉锛屾渶鍚庡皢鍚堝苟鍚庣殑鏀瑰姩鎻愪氦鍒皉epository
涓嬮潰鎴戝皢step by step鍦版紨绀哄浣曚竴娆″畬鏁寸殑branching鍜宮erging锛屽寘鎷垱寤哄垎鏀€佸垎鏀紑鍙戙€佸垎鏀拰涓荤嚎鍚屾锛屽垎鏀悎骞跺埌涓荤嚎鐨勫叏杩囩▼锛岀敋鑷冲寘鎷浣曞湪鏈湴鍒涘缓涓€涓祴璇曠敤鐨剅epository銆?/p>
棣栧厛闇€瑕佸畨瑁匱ortoiseSVN锛屾垜瀹夎鐨勭増鏈槸锛歍ortoiseSVN 1.6.15, Build 21041 - 32 Bit , 2011/03/23 18:00:27
1銆佹湰鍦癛epository鐨勫垱寤?/strong>
repository鐨勫垱寤哄緢绠€鍗曪紝鍋囪鎴戣鍦―:\TortoiseSVN\TestRepository鐩綍涓垱寤簉epository锛屽彧闇€鍙抽敭TestRepository鐩綍锛屼緷娆¢€夋嫨"TortoiseSVN" -> "Create repository here"渚垮畬鎴愪簡repository鐨勫垱寤恒€?/p>
2銆丆heck out
鍋囪瑕乧heck out鍒癉:\TortoiseSVN\TestSVN锛屽悓鏍峰緢绠€鍗曪紝鍦―:\TortoiseSVN鐩綍涓嬪垱寤篢estSVN鐩綍锛岀劧鍚庡湪璇ョ洰褰曚笂鍙抽敭锛岄€夋嫨"SVN Check out..."锛屽湪寮瑰嚭鐨勭獥鍙d腑鐨?URL of repository"涓~鍏?file:///D:/TortoiseSVN/TestRepository"锛屽叾浠栭粯璁ゅ嵆鍙紝鏈€鍚庣偣鍑籵k銆?/p>
3銆乼runk鍒涘缓鏂伴」鐩甅yProject
鐩稿綋绠€鍗曞氨涓嶈禈杩颁簡锛屽彧鍒楀嚭鏈鎿嶄綔鎵€浣滃嚭鐨勪慨鏀癸細
4銆佸垱寤篵ranch
鍦?trunk/MyProject鐩綍涓婂彸閿紝渚濇閫夋嫨"TortoiseSVN" -> "Branch/tag..."锛屽湪寮瑰嚭绐楀彛鐨?To URL"涓~鍏ュ垎鏀殑鍦板潃锛屽湪杩欓噷鐩爣revision閫夋嫨HEAD revision锛屽涓嬪浘鎵€绀猴紝娣诲姞log鍚庣偣鍑籵k鍒嗘敮渚垮缓绔嬩簡銆傝繖涓搷浣滈€熷害闈炲父蹇紝鏂板缓鐨刡ranch鍦╮epository涓叾瀹炲彧鏄竴涓寚鍚憈runk鏌愪釜revision鐨勮蒋杩炴帴鑰屽凡锛屽苟娌℃湁鐪熺殑澶嶅埗鏂囦欢銆?/p>
5銆丆heck out鍒嗘敮
鍙抽敭TestSVN鐩綍閫夋嫨"TortoiseSVN Update"鍗冲彲灏嗗垰鍒氬缓绔嬬殑鍒嗘敮涓嬭浇鍥炴湰鍦般€傝繘鍏?branches/MyProject鐩綍涓嬩綘浼氬彂鐜板叾鏂囦欢缁撴瀯鍜?trunk/MyProject涓€妯′竴鏍枫€?/p>
6銆乥ranch鎻愪氦涓€涓柊鏂囦欢
7銆乼runk绱ф帴鐫€鎻愪氦涓€涓慨鏀?/strong>
8銆乥ranch鍐嶆鎻愪氦涓€涓慨鏀?/strong>
9銆佸皢trunk涓殑淇敼鍚屾鍒癰ranch
6-8婕旂ず鐨勬槸branch鍜宼runk鍦ㄧ嫭绔嬨€佸苟琛屽湴寮€鍙戙€備负浜嗛槻姝㈠湪“閿欒”鐨勯亾璺笂瓒婅蛋瓒婅繙锛岀幇鍦╞ranch鎰忚瘑鍒版槸鏃跺€欏拰trunk鏉ヤ竴娆″悓姝ヤ簡锛堝皢trunk鍚堝苟鍒癰ranch锛夈€?/p>
棣栧厛锛屽湪鏈湴trunk涓厛update涓€涓嬶紝鏈夊啿绐佺殑瑙e喅鍐茬獊锛屼繚璇乼runk鍜宺epository宸茬粡瀹屽叏鍚屾锛岀劧鍚庡湪/branches/MyProject涓婂彸閿紝渚濇閫夋嫨"TortoiseSVN" -> “Merge...”锛屽湪寮瑰嚭鐨勭獥鍙d腑閫夋嫨绗竴椤?Merge a range of revision"锛岃繖涓被鍨嬬殑Merge宸茬粡浠嬬粛寰楀緢娓呮锛岄€傜敤浜庡皢鏌愪釜鍒嗘敮鎴栦富绾夸笂鎻愪氦鐨勫涓猺evision闂寸殑鍙樺寲鍚堝苟鍒板彟澶栦竴涓垎鏀笂銆?/p>
鐐瑰嚮next鍚庯紝鍑虹幇濡備笅绐楀彛锛?/p>
鐢变簬鏄浠巘runk鍚堝苟鍒癰ranch锛岀悊鎵€褰撶劧杩欓噷鐨?URL to merge from"搴旇濉玹runk鐨勮矾寰勶紝"Revision range to merge"寰堝ソ鐞嗚В锛屽氨鏄綘瑕佸皢trunk鐨勫摢浜況evision鎵€瀵瑰簲鐨勫彉鍖栧悎骞跺埌branch涓紝鍙互鏄煇涓€杩炰覆鐨剅evision锛屾瘮濡?-7锛?5-HEAD锛屼篃鍙互鏄煇涓崟鐙殑revision鍙枫€傜敱浜庡湪r4涓紝trunk淇敼浜哖erson.java涓殑talk()鏂规硶锛屾墍浠ヨ繖閲岀殑revision鍙渶濉?鍗冲彲銆傜偣鍑籲ext鍚庡嚭鐜颁笅鍥撅細
鍦ㄨ繖閲屽彧闇€淇濈暀榛樿璁剧疆鍗冲彲銆傚湪鐐瑰嚮Merge鎸夐挳鍓嶄綘鍙互鍏圱est merge涓€鎶婏紝鐪嬫垚鍔熶笌鍚︼紝浠ュ強merge鐨勮缁嗕俊鎭€傜偣鍑籑erge鎸夐挳鍚巘runk鎵€鍋氱殑淇敼灏嗗悓姝ュ埌branch涓€?/p>
10銆佹彁浜ゅ悎骞跺悗鐨刡ranch
鑷虫锛宐ranch宸茬粡瀹屽叏鍜宼runk鍚屾锛宐ranch鍜宼runk鐨勪唬鐮佺浉澶勫緢铻嶆唇锛屾病鏈変换浣曞啿绐侊紝濡傛灉branch宸茬粡寮€鍙戠粨鏉燂紝閭f槸鏃跺€欏皢branch鍚堝苟鍥瀟runk浜嗭紝褰撶劧锛屽鏋渂ranch杩樿缁х画寮€鍙戯紝閭d綘灏嗕笉鏂湴閲嶅6-10杩欏嚑涓楠ゃ€?/p>
11銆佸皢branch鍚堝苟鍥瀟runk
鍦?trunk/MyProject涓婂彸閿紙娉ㄦ剰鏄湪涓荤嚎鐨勭洰褰曚笂鍙抽敭锛夛紝渚濇閫夋嫨"TortoiseSVN" -> "Merge..."锛屽湪寮瑰嚭鐨勭獥鍙d腑锛孧erge type閫夋嫨绗簩椤?Reintegrate a branch"锛岃繖绉嶇被鍨嬬殑鍚堝苟閫傚悎鍦ㄥ垎鏀紑鍙戠粨鏉熷悗灏嗘墍鏈夌殑鏀瑰姩鍚堝苟鍥炰富绾裤€?/p>
鐐瑰嚮next鍚庡嚭鐜板涓嬬獥鍙o細
鍦ㄨ繖閲岋紝"From URL"閫夋嫨/branches/MyProject锛屾棤闇€閫夋嫨revision鍙凤紝Reintegrate浼氬皢branch涓婃墍鏈変慨鏀瑰悎骞跺埌trunk銆傚悗闈㈢殑姝ラ鍜屼笂鏂囩9姝ヤ腑鐨勪竴鏍凤紝涓嶅啀鍟板棪浜嗐€傚鏃犳剰澶栵紝branch灏嗘垚鍔熷悎骞跺埌trunk锛屼綘闇€瑕佸仛鐨勫彧鏄皢鍚堝苟鍚庣殑trunk璧剁揣commit锛?/p>
12銆佹彁浜ゅ悎骞跺悗鐨則runk
so easy...
13銆佸垹闄ranch
濡傛灉浣犺涓轰綘鏂板姞鐨勫姛鑳藉凡缁忓紑鍙戝畬鎴愪簡锛屼綘鍙互鍒犻櫎浣犵殑鍒嗘敮
鍒拌繖閲岋紝鎴戝凡缁忕粰浣犳紨绀哄畬浜嗘暣涓繃绋嬶紝鎴戜竴韬殑姹椾篃涓嬫潵浜嗭紝鎴戞兂缃㈠伐浜嗭紝涓嶈繃鏈€鍚庢垜浠繕鏄湅鐪嬫墍鏈夌殑log淇℃伅鍚э紝閫氳繃log鑳藉彂鐜版垜浠共鐨勬墍鏈変簨鎯咃細
r1-r7姝f槸鎴戜笂鏂囧湪骞茬殑浜嬫儏锛屼粠Message涓綘鑳藉彂鐜版垜瀵箃runk鍜宐ranch閮藉共浜嗕粈涔堬紝鍙﹀锛屽湪Log Messages绐楀彛鐨勫乏涓嬭鍕鹃€変簡"Include merged revisions"浣犺繕鑳界湅鍒伴澶栫殑Merge information锛?/p>
鍥句腑鐏拌壊鐨勬槸鍜宮erge鐩稿叧鐨刲og锛屽叡鍙戠敓浜嗕袱娆erge锛岀涓€娆℃槸鍦╮6锛屽湪r6涓紝branch鍚堝苟浜唗runk鍦╮4鏃舵彁浜ょ殑鍙樺寲锛涚浜屾鏄湪r7锛屽湪r7涓紝trunk鍚堝苟浜哹ranch浠巖2鍒皉6鐨勬墍鏈夊彉鍖栥€?/p>
缁堜簬鍙互鍐欏啓鎬荤粨浜嗭細
- branch涓昏鐢ㄤ簬鏂板姛鑳界殑寮€鍙?/li>
- 鍚堝苟鍙戠敓鍦ㄦ湰鍦皐orking copy锛屽彧瑕佷綘涓嶆彁浜ゅ氨涓嶄細褰卞搷鍒皉epository
- 鍚堝苟鍓嶄竴瀹氳鍏坲pdate銆乧ommit锛屼繚璇佷笉浼歰ut of day锛屽苟灏嗘湰鍦扮殑淇敼淇濆瓨鍒皉epository
- branch鍜宼runk骞惰寮€鍙戠殑杩囩▼涓紝瑕佺粡甯稿悓姝ワ紝灏唗runk鐨勪慨鏀瑰悎骞跺埌branch锛屽悎骞舵椂閫夋嫨"Merge a range of revision"
-
branch鏈€鍚庡悎骞跺洖trunk鏃讹紝merge type閫夋嫨"Reintegrate a branch"
鍑哄锛?a href="http://blog.csdn.net/eggcalm/article/details/6606520">http://blog.csdn.net/eggcalm/article/details/6606520
以上是关于SVN鍒嗘敮鐨勫悎骞跺拰鍚屾的主要内容,如果未能解决你的问题,请参考以下文章