1.å¦ä½å¨TFSä¸ä½¿ç¨Git
å¦ä½å¨TFSä¸ä½¿ç¨Git
1. ä¸è½½ Visual Studio æ©å±
ãã没æå®è£ æ©å±ä¹åï¼å¢éèµæºç®¡çå¨ä¸åªæ¾ç¤º TFSã
ããéæ© âå·¥å ·â -> âæ©å±æ´æ°âï¼è¿å ¥å¦ä¸çé¢ã
å¨è¾å ¥æ¡ä¸è¾å ¥âgitâ
ããå®è£ å®æåï¼éå¯ Visual Studioï¼ä¼åç°å¢éèµæºç®¡çå¨çé¢å¤äº Git çæ ç®ã
ãã2. æ°å»ºé¡¹ç®
ããéæ©æ§å¶å°åºç¨ç¨åºï¼åæ¶å¾é âæ·»å å°æºä»£ç 管çâã
ãã第ä¸æ¬¡è¿å ¥é¡¹ç®çæ¶åï¼ä¼è¯·ä½ éæ©æ³è¦çæºä»£ç 管çç³»ç»ï¼è¿éæ们éæ© âGitâã
ããå½éæ©å®æºä»£ç 管çç³»ç»åï¼Visual Studio ä¼å¯¹ Git è¿è¡åå§è®¾ç½®ã
该项ç®ç Repository å·²ç»å建æå
ããè¿æ¶åï¼æ们æ¥ç解å³æ¹æ¡èµæºç®¡çå¨ï¼å¯ä»¥çå°å¨æ¯ä¸ªé¡¹ç®åé½å¤äºä¸ªæºä»£ç æ§å¶çç¶æå¾æ ã
â+â 代表该æ件æ¯æ°æ·»å ç
ããå³é®åå»æ¯ä¸é¡¹ï¼ä¼åç°å¨ä¸ä¸æèåä¸å¤äºä¸ä¸ªæ°ä¸ä¸ï¼ UndoãView HistoryãCommitãè¿äºæ¯æºä»£ç æ§å¶çå¿«æ·èåã
ãã3. é ç½® Git æºä»£ç 管çå·¥å ·
ããæå¼ âå¢éèµæºç®¡çå¨âï¼æ¾ç¤ºå¦ä¸ï¼
âæ示å®è£ 第ä¸æ¹å½ä»¤è¡å·¥å ·âï¼ç®åç¨ä¸å°ï¼ææ¶å¿½ç¥
ããç¹å» âChangesâ
ããæ¤æ¶å¢éèµæºç®¡çå¨ä¼åæ¢å° âChangesâ çé¢ï¼è¯¥çé¢ä¼ååºæææ¬æ¬¡ä¿®æ¹è¿ç代ç ã
ããå¨æ们æ£å¼ç¾å ¥ä»£ç ä¹åï¼è¿éè¦å¯¹ Git è¿è¡ä¸æ¬¡é ç½®ï¼å¦å âCommitâ æé®å°ä¸ç´æ¾ç¤ºç°è²ï¼æ æ³ç¹å»ã
ããç¹å» âConfigâ å°±å¯ä»¥è¿å ¥å°é ç½®çé¢ï¼å¨æ¤è¾å ¥ç¨æ·åãé®ç®±ï¼ç¨ä»¥å¨æºä»£ç 管çå¨çåå²è®°å½ä¸æ¾ç¤ºæ次ç¾å ¥ç人åä¿¡æ¯ãå¡«åå®æ¯åï¼ç¹å» âUpdateâã
ããç¨æ·åãé®ç®±å¹¶ä¸ä½ä¸ºç»å½TFSçåæ®ï¼åªæ¯ç¨äºæ è¯æ次ç¾å ¥äººç代å·ï¼å¯ä»¥ä»»æå¡«åãä¸è¿°é ç½®å¯ä»¥å¨åæè¿è¡ä¿®æ¹ã
ãã4. 项ç®ç¾å ¥
ããååå° âChangesâ çé¢ï¼ å¡«åæ¬æ¬¡ç¾å ¥çæè¿°ä¿¡æ¯åç¹å» âCommitâ è¿è¡ç¾å ¥ã
ããæ们è¿æªè¿æ¥è¿ä»»ä½æºä»£ç æ管æå¡å¨ï¼æ以ç°å¨ç âç¾å ¥â åªæ¯ç¾å ¥å°æ¬å°ä»£ç åºä¸ãå æ¤ä½ ä¼åç°ç¾å ¥çé度æå¿«ï¼ç¾å ¥æååï¼æ¾ç¤ºå¦ä¸ä¿¡æ¯ã
Commit XXX created locally. Sync to share your changes with the server.
ããç¹å» âCommit aâï¼æ¥çæ¬æ¬¡ç¾å ¥ç详ç»æ åµã
ããåå°è§£å³æ¹æ¡èµæºç®¡çå¨ï¼ä¼åç°åå ç â+â å·åæäºä¸æå°éï¼è¿è¡¨ç¤ºè¯¥æ件已ç»ç¾å ¥æåäºã
ãã5. ä¿®æ¹ä»£ç
ããä¿®æ¹Program.csä¸ç代ç ï¼ä¼åç°å°éåæäºä¸ä¸ª âå¾åâï¼è¿è¡¨ç¤ºè¯¥æ件已ç»å¨æ¬å°è¿è¡äºä¿®æ¹ã
ããå³é®åå»è§£å³æ¹æ¡èµæºç®¡çå¨ä¸ç âProgram.csâ ï¼éæ© âSource Controlâ -> âCompare with Umodifiedâ æ¯è¾ä¸ä¸å½åçæ¬åä¸ä¸ä¸ªçæ¬çåºå«ã
éæ© âCompare with Umodifiedâ
âæ¯è¾â é¢æ¿
ããç¾å ¥æ¬æ¬¡æ¹å¨åï¼æ¥çåå²è®°å½ã
âåå²è®°å½â é¢æ¿
ããæªæ¢ç®å为æ¢ï¼æ们对代ç ççæ¬ç®¡çæä½é½åªæ¯åºäºæ¬å°ç代ç åºï¼å¹¶æ²¡æè¿æ¥å°ç½ç»ä¸çæå¡å¨ãè¿å¯¹äºä¸ªäººå¼åè æ¥è¯´æ¯ä¸ªç»å¦çäºæ ã
ãã6. åæ¥å°äºç«¯ç TFS æå¡å¨
ãã6.1 ä½¿ç¨ Visual Studio Online 建ç«æå¡å¨[6]
ãã对äºå°äº5个人çå°åå¼åå¢éèè¨ï¼å¯ä»¥ä½¿ç¨ Visual Studio Online æ¥å 费维æ¤èªå·±ç代ç ã
ããå¨æµè§å¨ä¸è¾å ¥ â/â è¿æ¥å° Visual Studio Onlineï¼ä¸ä¸ªå¾®è½¯è´¦æ·åªè½å建ä¸ä¸ª Visual Studio Online è´¦æ·ã
ããå建ä¸ä¸ªä»£ç åºï¼éæ©å°ä½¿ç¨çæºä»£ç 管çå·¥å ·ã
å建æ°ä»£ç åº
å建æå
ããç¹å»å·¦ä¸è§ç âCodeâ é项ï¼è¿å ¥ âCodeâ 页é¢ã第ä¸æ¬¡è¿å ¥è¯¥é¡µé¢ï¼ä¼æ示å¦ä½è¿æ¥å°æ¤ä»£ç åºãå¤å¶ä»£ç åºå°åã
ãã6.2 代ç åæ¥å°æ°å建ç代ç åºä¸
ããåå° Visual Studio,码托rs274 源码 éæ© âUnsynced Commitsâï¼å°ä¸é¢å¤å¶çå°åç²è´´å°å¯¹å°±çä½ç½®ã
Unsynced Commits çé¢
å°å°åç²è´´å°è¾å ¥æ¡
ããç¹å» âPublishâï¼ä¾¿å¼å§å°æ¬å°ä»£ç åºä¸çæ°æ®åæ¥å°æå¡å¨ã
ç¹å» âPublishâ
æææå
ãã7. å¨æå¡å¨ç«¯æ¥ç代ç
ããå½æ°æ®åæ¥æååï¼æ们å¯ä»¥è¿å ¥æå¡å¨æ¥ç代ç ç¶æã
ããè¿æ¯è¿å ¥ âCodeâ 页é¢ï¼æ¤æ¶å·²ç»è½æ£å¸¸çå°åææ交è¿ç代ç äºã
ããæ¥çåå²è®°å½ï¼å¯ä»¥çå°æææ¬å°çåå²çæ¬é½å·²ç»è¢«æ£ç¡®åæ¥å°äºæå¡å¨ç«¯ã
ããä¸é¢ï¼æåªæ¯æ¼ç¤ºäºå¦ä½å°æ°å»ºç项ç®æ·»å å°äºç«¯çTFSãä½ å®å ¨å¯ä»¥å°å·²æç项ç®æ·»å å°æºä»£ç 管çæ§å¶ç³»ç»
2024-12-29 01:50
2024-12-29 01:47
2024-12-29 01:39
2024-12-29 01:19
2024-12-29 00:38
2024-12-29 00:27
2024-12-29 00:19
2024-12-28 23:52