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锛夌殑涓€涓嫹璐濓紝瑙佷笅鍥撅細

鎶€鏈垎浜? src=

 

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

鐩稿綋绠€鍗曞氨涓嶈禈杩颁簡锛屽彧鍒楀嚭鏈鎿嶄綔鎵€浣滃嚭鐨勪慨鏀癸細

鎶€鏈垎浜? src=

 

4銆佸垱寤篵ranch

鍦?trunk/MyProject鐩綍涓婂彸閿紝渚濇閫夋嫨"TortoiseSVN" -> "Branch/tag..."锛屽湪寮瑰嚭绐楀彛鐨?To URL"涓~鍏ュ垎鏀殑鍦板潃锛屽湪杩欓噷鐩爣revision閫夋嫨HEAD revision锛屽涓嬪浘鎵€绀猴紝娣诲姞log鍚庣偣鍑籵k鍒嗘敮渚垮缓绔嬩簡銆傝繖涓搷浣滈€熷害闈炲父蹇紝鏂板缓鐨刡ranch鍦╮epository涓叾瀹炲彧鏄竴涓寚鍚憈runk鏌愪釜revision鐨勮蒋杩炴帴鑰屽凡锛屽苟娌℃湁鐪熺殑澶嶅埗鏂囦欢銆?/p>

鎶€鏈垎浜? src=

 

5銆丆heck out鍒嗘敮

鍙抽敭TestSVN鐩綍閫夋嫨"TortoiseSVN Update"鍗冲彲灏嗗垰鍒氬缓绔嬬殑鍒嗘敮涓嬭浇鍥炴湰鍦般€傝繘鍏?branches/MyProject鐩綍涓嬩綘浼氬彂鐜板叾鏂囦欢缁撴瀯鍜?trunk/MyProject涓€妯′竴鏍枫€?/p>

 

6銆乥ranch鎻愪氦涓€涓柊鏂囦欢

鎶€鏈垎浜? src=

 

7銆乼runk绱ф帴鐫€鎻愪氦涓€涓慨鏀?/strong>

鎶€鏈垎浜? src=

 

8銆乥ranch鍐嶆鎻愪氦涓€涓慨鏀?/strong>

鎶€鏈垎浜? src=

 

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>

鎶€鏈垎浜? src=

 

鐐瑰嚮next鍚庯紝鍑虹幇濡備笅绐楀彛锛?/p>

鎶€鏈垎浜? src=

 

鐢变簬鏄浠巘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鍚庡嚭鐜颁笅鍥撅細

鎶€鏈垎浜? src=

 

鍦ㄨ繖閲屽彧闇€淇濈暀榛樿璁剧疆鍗冲彲銆傚湪鐐瑰嚮Merge鎸夐挳鍓嶄綘鍙互鍏圱est merge涓€鎶婏紝鐪嬫垚鍔熶笌鍚︼紝浠ュ強merge鐨勮缁嗕俊鎭€傜偣鍑籑erge鎸夐挳鍚巘runk鎵€鍋氱殑淇敼灏嗗悓姝ュ埌branch涓€?/p>

 

10銆佹彁浜ゅ悎骞跺悗鐨刡ranch

鎶€鏈垎浜? src=

 

鑷虫锛宐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>

鎶€鏈垎浜? src=

 

鐐瑰嚮next鍚庡嚭鐜板涓嬬獥鍙o細

鎶€鏈垎浜? src=

 

鍦ㄨ繖閲岋紝"From URL"閫夋嫨/branches/MyProject锛屾棤闇€閫夋嫨revision鍙凤紝Reintegrate浼氬皢branch涓婃墍鏈変慨鏀瑰悎骞跺埌trunk銆傚悗闈㈢殑姝ラ鍜屼笂鏂囩9姝ヤ腑鐨勪竴鏍凤紝涓嶅啀鍟板棪浜嗐€傚鏃犳剰澶栵紝branch灏嗘垚鍔熷悎骞跺埌trunk锛屼綘闇€瑕佸仛鐨勫彧鏄皢鍚堝苟鍚庣殑trunk璧剁揣commit锛?/p>

 

12銆佹彁浜ゅ悎骞跺悗鐨則runk

so easy...

 

13銆佸垹闄ranch

濡傛灉浣犺涓轰綘鏂板姞鐨勫姛鑳藉凡缁忓紑鍙戝畬鎴愪簡锛屼綘鍙互鍒犻櫎浣犵殑鍒嗘敮

 

 

鍒拌繖閲岋紝鎴戝凡缁忕粰浣犳紨绀哄畬浜嗘暣涓繃绋嬶紝鎴戜竴韬殑姹椾篃涓嬫潵浜嗭紝鎴戞兂缃㈠伐浜嗭紝涓嶈繃鏈€鍚庢垜浠繕鏄湅鐪嬫墍鏈夌殑log淇℃伅鍚э紝閫氳繃log鑳藉彂鐜版垜浠共鐨勬墍鏈変簨鎯咃細

鎶€鏈垎浜? src=

 

r1-r7姝f槸鎴戜笂鏂囧湪骞茬殑浜嬫儏锛屼粠Message涓綘鑳藉彂鐜版垜瀵箃runk鍜宐ranch閮藉共浜嗕粈涔堬紝鍙﹀锛屽湪Log Messages绐楀彛鐨勫乏涓嬭鍕鹃€変簡"Include merged revisions"浣犺繕鑳界湅鍒伴澶栫殑Merge information锛?/p>

鎶€鏈垎浜? src=

 

鍥句腑鐏拌壊鐨勬槸鍜宮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鍒嗘敮鐨勫悎骞跺拰鍚屾的主要内容,如果未能解决你的问题,请参考以下文章

git 鍒嗘敮鎿嶄綔

鍚堝苟鐨勮壓鏈?.0锛氬悎骞堕摼琛ㄣ€佹暟缁勩€佷簩鍙夋爲

瀹屾暣妗堜緥鈥斺€旈厤缃墠绔拰鍚庣API搴旂敤鐨勫畨鍏ㄨ璇佲€斺€斿熀浜嶢zure瀹炵幇

鎬庢牱鐞嗚В闃诲闈為樆濉炰笌鍚屾寮傛鐨勫尯鍒紵

甯哥敤 Git 鍛戒护

Spark + Hadoop,鍩轰簬WIFI鎺㈤拡鐨勫ぇ鏁版嵁鍒嗘瀽绯荤粺