{"id":81375,"date":"2024-11-25T09:17:51","date_gmt":"2024-11-25T02:17:51","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=81375"},"modified":"2025-07-10T10:37:08","modified_gmt":"2025-07-10T03:37:08","slug":"tong-quan-git-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/","title":{"rendered":"Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#He_thong_quan_ly_phien_ban_Version_Control_System_%E2%80%93_VCS\" >H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n (Version Control System &#8211; VCS)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#Phan_loai_he_thong_quan_ly_phien_ban\" >Ph\u00e2n lo\u1ea1i h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#Git_la_gi\" >Git l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#Cac_thuat_ngu_co_ban_trong_Git\" >C\u00e1c thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n trong Git<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#Nguyen_ly_hoat_dong_cua_git\" >Nguy\u00ean l\u00fd ho\u1ea1t \u0111\u1ed9ng c\u1ee7a git<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#Huong_dan_cach_cai_dat_va_cau_hinh_Git\" >H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh Git<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#Cac_cau_hoi_thuong_gap_ve_Git_la_gi\" >C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Git l\u00e0 g\u00ec<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#Tong_ket_Git_la_gi\" >T\u1ed5ng k\u1ebft Git l\u00e0 g\u00ec<\/a><\/li><\/ul><\/nav><\/div>\n\n<p><em><strong>Trong l\u0129nh v\u1ef1c ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m ng\u00e0y nay, l\u00e0m vi\u1ec7c nh\u00f3m (teamwork) gi\u1eefa c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean \u0111\u00f3ng m\u1ed9t vai tr\u00f2 v\u00f4 c\u00f9ng quan tr\u1ecdng. Tuy nhi\u00ean, vi\u1ec7c nhi\u1ec1u ng\u01b0\u1eddi c\u00f9ng tham gia v\u00e0o m\u1ed9t m\u00e3 ngu\u1ed3n s\u1ebd d\u1eabn \u0111\u1ebfn nh\u1eefng kh\u00f3 kh\u0103n trong vi\u1ec7c qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n v\u00e0 h\u1ee3p nh\u1ea5t m\u00e3 ngu\u1ed3n. <\/strong><strong>Ch\u00ednh v\u00ec v\u1eady, Git &#8211; m\u1ed9t c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n hi\u1ec7u qu\u1ea3, \u0111\u00e3 tr\u1edf th\u00e0nh m\u1ed9t th\u00e0nh ph\u1ea7n kh\u00f4ng th\u1ec3 thi\u1ebfu trong c\u00e1c d\u1ef1 \u00e1n ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m. B\u00e0i vi\u1ebft sau \u0111\u00e2y s\u1ebd gi\u00fap c\u00e1c beginner hi\u1ec3u r\u00f5 v\u1ec1 b\u1ea3n ch\u1ea5t Git l\u00e0 g\u00ec.<\/strong><\/em><\/p>\n\n\n\n<p>\u0110\u1ecdc b\u00e0i vi\u1ebft sau \u0111\u00e2y \u0111\u1ec3 hi\u1ec3u r\u00f5:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Chi ti\u1ebft Git l\u00e0 g\u00ec v\u00e0 c\u00e1c kh\u00e1i ni\u1ec7m, thu\u1eadt ng\u1eef Git c\u01a1 b\u1ea3n c\u1ea7n bi\u1ebft<\/li>\n\n\n\n<li>C\u01a1 ch\u1ebf ho\u1ea1t \u0111\u1ed9ng c\u1ee7a Git<\/li>\n\n\n\n<li>C\u00e1ch c\u00e0i \u0111\u1eb7t Git chi ti\u1ebft<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-h\u1ec7-th\u1ed1ng-qu\u1ea3n-ly-phien-b\u1ea3n-version-control-system-vcs\"><span class=\"ez-toc-section\" id=\"He_thong_quan_ly_phien_ban_Version_Control_System_%E2%80%93_VCS\"><\/span><b>H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n (Version Control System &#8211; VCS)<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Tr\u01b0\u1edbc khi t\u00ecm hi\u1ec3u v\u1ec1 Git, ch\u00fang ta c\u1ea7n hi\u1ec3u r\u00f5 VCS l\u00e0 g\u00ec v\u00e0 ch\u1ee9c n\u0103ng ch\u00ednh c\u1ee7a n\u00f3. H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n (VCS) l\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng l\u01b0u gi\u1eef c\u00e1c phi\u00ean b\u1ea3n c\u1ee7a m\u00e3 ngu\u1ed3n s\u1ea3n ph\u1ea9m ph\u1ea7n m\u1ec1m. Khi c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean trong nh\u00f3m c\u00f3 nh\u1eefng thay \u0111\u1ed5i trong m\u00e3 ngu\u1ed3n, th\u00f4ng tin \u0111\u00f3 s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u l\u1ea1i m\u1ed9t c\u00e1ch minh b\u1ea1ch bao g\u1ed3m ng\u01b0\u1eddi thay \u0111\u1ed5i, th\u1eddi gian thay \u0111\u1ed5i, v\u00e0 n\u1ed9i dung thay \u0111\u1ed5i.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Ch\u00ednh v\u00ec v\u1eady, VCS c\u00f3 th\u1ec3 gi\u00fap c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean c\u00f3 m\u1ed9t c\u00e1i nh\u00ecn th\u1ed1ng nh\u1ea5t v\u00e0 t\u1ed5ng quan v\u1ec1 d\u1ef1 \u00e1n \u0111ang l\u00e0m, c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng truy xu\u1ea5t th\u00f4ng tin thay \u0111\u1ed5i ho\u1eb7c l\u1ea5y l\u1ea1i phi\u00ean b\u1ea3n m\u00e3 ngu\u1ed3n trong qu\u00e1 kh\u1ee9.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-phan-lo\u1ea1i-h\u1ec7-th\u1ed1ng-qu\u1ea3n-ly-phien-b\u1ea3n\"><span class=\"ez-toc-section\" id=\"Phan_loai_he_thong_quan_ly_phien_ban\"><\/span><b>Ph\u00e2n lo\u1ea1i h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-h\u1ec7-th\u1ed1ng-qu\u1ea3n-ly-phien-b\u1ea3n-c\u1ee5-c-b\u1ed9-local-version-control-system\"><b>H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n c\u1ee5<\/b><strong>c b\u1ed9 (Local version control system)<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u00e0 d\u1ea1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ngay tr\u00ean m\u00e1y t\u00ednh c\u00e1 nh\u00e2n c\u1ee7a ng\u01b0\u1eddi d\u00f9ng. Trong lo\u1ea1i n\u00e0y, m\u1ed7i khi c\u00f3 s\u1ef1 thay \u0111\u1ed5i, h\u1ec7 th\u1ed1ng s\u1ebd t\u1ea1o ra m\u1ed9t b\u1ea3n sao c\u1ee5c b\u1ed9. N\u00f3 cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng quay l\u1ea1i phi\u00ean b\u1ea3n c\u0169, tuy nhi\u00ean kh\u00f4ng h\u1ed7 tr\u1ee3 cho l\u00e0m vi\u1ec7c nh\u00f3m v\u00e0 c\u1ed9ng t\u00e1c t\u1eeb xa.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"388\" height=\"347\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-cuc-bo-vippro.png\" alt=\"h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n c\u1ee5c b\u1ed9 - itviec blog\" class=\"wp-image-81611\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-cuc-bo-vippro.png 388w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-cuc-bo-vippro-300x268.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-cuc-bo-vippro-200x179.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-cuc-bo-vippro-100x89.png 100w\" sizes=\"auto, (max-width: 388px) 100vw, 388px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">M\u1ed9t v\u00ed d\u1ee5 \u0111i\u1ec3n h\u00ecnh cho lo\u1ea1i n\u00e0y \u0111\u00f3 l\u00e0 <\/span><a href=\"http:\/\/www.gnu.org\/software\/rcs\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Revision Control System<\/span><\/a><span style=\"font-weight: 400;\"> (RCS), \u0111\u01b0\u1ee3c ph\u00e1t h\u00e0nh v\u00e0o n\u0103m 1982 b\u1edfi Walter F. Tichy.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-h\u1ec7-th\u1ed1ng-qu\u1ea3n-ly-phien-b\u1ea3n-t\u1eadp-tru-ng-centralized-version-control-system\"><b>H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n t\u1eadp tru<\/b><strong>ng (Centralized version control system)<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u00e0 h\u1ec7 th\u1ed1ng g\u1ed3m m\u1ed9t m\u00e1y ch\u1ee7 ch\u1ee9a to\u00e0n b\u1ed9 d\u1eef li\u1ec7u phi\u00ean b\u1ea3n kh\u00e1c nhau c\u1ee7a d\u1ef1 \u00e1n, v\u00e0 m\u1ecdi ng\u01b0\u1eddi trong team c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng \u0111\u1ec3 chia s\u1ebb v\u00e0 truy xu\u1ea5t d\u1eef li\u1ec7u c\u1ee7a nhau.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"466\" height=\"547\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-tap-trung-vippro.png\" alt=\"h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n t\u1eadp trung - itviec blog\" class=\"wp-image-81612\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-tap-trung-vippro.png 466w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-tap-trung-vippro-256x300.png 256w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-tap-trung-vippro-170x200.png 170w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-tap-trung-vippro-85x100.png 85w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-tap-trung-vippro-383x450.png 383w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">M\u1ed9t h\u1ec7 th\u1ed1ng n\u1ed5i b\u1eadt v\u00e0 ph\u1ed5 bi\u1ebfn thu\u1ed9c lo\u1ea1i n\u00e0y l\u00e0 Apache <\/span><span style=\"font-weight: 400;\">Subversion (SVN), \u0111\u01b0\u1ee3c t\u1ea1o ra b\u1edfi CollabNet Inc. v\u00e0o n\u0103m 2000 v\u00e0 hi\u1ec7n l\u00e0 m\u1ed9t d\u1ef1 \u00e1n c\u1ea5p cao c\u1ee7a Apache, \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng v\u00e0 s\u1eed d\u1ee5ng b\u1edfi c\u1ed9ng \u0111\u1ed3ng c\u00e1c c\u1ed9ng t\u00e1c vi\u00ean tr\u00ean to\u00e0n th\u1ebf gi\u1edbi.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-h\u1ec7-th\u1ed1ng-qu\u1ea3n-ly-phien-b\u1ea3n-phan-tan-distributed-version-control-systems\"><b>H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ph\u00e2n<\/b><strong> t\u00e1n (Distributed Version Control Systems)<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong h\u1ec7 th\u1ed1ng n\u00e0y, khi m\u1ed9t client truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb m\u00e1y ch\u1ee7, n\u00f3 kh\u00f4ng ch\u1ec9 l\u1ea5y v\u1ec1 d\u1eef li\u1ec7u \u1edf phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t, m\u00e0 n\u00f3 c\u00f2n t\u1ea3i v\u1ec1 c\u1ea3 kho ch\u1ee9a c\u1ee7a h\u1ec7 th\u1ed1ng, hay c\u00f2n g\u1ecdi l\u00e0 repository. Trong tr\u01b0\u1eddng h\u1ee3p m\u00e1y ch\u1ee7 t\u1eeb xa c\u00f3 tr\u1ee5c tr\u1eb7c, th\u00ec nh\u1eefng client \u0111\u00e3 t\u1ea3i v\u1ec1 tr\u01b0\u1edbc \u0111\u00f3 v\u1eabn c\u00f2n kho l\u01b0u tr\u1eef, v\u00e0 c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng \u0111\u1ec3 kh\u00f4i ph\u1ee5c d\u1eef li\u1ec7u c\u1ee7a m\u00e3 ngu\u1ed3n.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Git ch\u00ednh l\u00e0 m\u1ed9t trong c\u00e1c h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ph\u00e2n t\u00e1n.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"418\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-phan-tan-vippro.png\" alt=\"h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ph\u00e2n t\u00e1n - itviec blog\" class=\"wp-image-81613\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-phan-tan-vippro.png 500w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-phan-tan-vippro-300x251.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-phan-tan-vippro-200x167.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-he-thong-quan-ly-phien-ban-phan-tan-vippro-100x84.png 100w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-git-la-gi\"><span class=\"ez-toc-section\" id=\"Git_la_gi\"><\/span><b>Git l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git l\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ph\u00e2n t\u00e1n (Distributed Version Control Systems) \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng m\u1ed9t c\u00e1ch r\u1ed9ng r\u00e3i trong l\u0129nh v\u1ef1c ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m. Git th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng k\u1ebft h\u1ee3p v\u1edbi c\u00e1c d\u1ecbch v\u1ee5 l\u01b0u tr\u1eef m\u00e3 ngu\u1ed3n t\u1eeb xa nh\u01b0 Github, Gitlab hay Bitbucket \u0111\u1ec3 h\u1ed7 tr\u1ee3 c\u1ed9ng t\u00e1c t\u1eeb xa, n\u00e2ng cao ch\u1ea5t l\u01b0\u1ee3ng l\u00e0m vi\u1ec7c nh\u00f3m trong d\u1ef1 \u00e1n.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-l\u1ecbch-s\u1eed-hinh-thanh-c\u1ee7a-git\"><b>L\u1ecbch s\u1eed h\u00ecnh th\u00e0nh c\u1ee7a Git<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Git \u0111\u01b0\u1ee3c ph\u00e1t tri\u1ec3n b\u1edfi <\/span><span style=\"font-weight: 400;\">Linus Torvalds<\/span><span style=\"font-weight: 400;\"> v\u00e0o n\u0103m 2005, l\u00e0 ph\u1ea7n m\u1ec1m m\u00e3 ngu\u1ed3n m\u1edf \u0111\u01b0\u1ee3c ph\u00e2n ph\u1ed1i theo gi\u1ea5y ph\u00e9p c\u00f4ng c\u1ed9ng <\/span><span style=\"font-weight: 400;\">GPL2<\/span><span style=\"font-weight: 400;\">. Ban \u0111\u1ea7u d\u00e0nh cho vi\u1ec7c ph\u00e1t tri\u1ec3n <\/span><span style=\"font-weight: 400;\">nh\u00e2n<\/span><span style=\"font-weight: 400;\"> <a href=\"https:\/\/itviec.com\/blog\/linux\/\" target=\"_blank\" rel=\"noopener\">Linux<\/a>, nh\u01b0ng hi\u1ec7n nay, Git \u0111\u00e3 tr\u1edf th\u00e0nh m\u1ed9t trong c\u00e1c ph\u1ea7n m\u1ec1m qu\u1ea3n l\u00fd <\/span><span style=\"font-weight: 400;\">m\u00e3 ngu\u1ed3n<\/span><span style=\"font-weight: 400;\"> ph\u1ed5 bi\u1ebfn nh\u1ea5t.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-ch\u1ee9c-nang-chinh-c\u1ee7a-git\"><b>Ch\u1ee9c n\u0103ng ch\u00ednh c\u1ee7a Git<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Git \u0111\u00f3ng m\u1ed9t vai tr\u00f2 quan tr\u1ecdng trong xuy\u00ean su\u1ed1t qu\u00e1 tr\u00ecnh l\u00e0m vi\u1ec7c c\u1ee7a c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean, nh\u1eefng ch\u1ee9c n\u0103ng n\u1ed5i b\u1eadt c\u1ee7a Git ph\u1ea3i k\u1ec3 \u0111\u1ebfn:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Theo d\u00f5i l\u1ecbch s\u1eed thay \u0111\u1ed5i c\u1ee7a m\u00e3 ngu\u1ed3n: V\u1edbi kh\u1ea3 n\u0103ng l\u01b0u tr\u1eef m\u1ed9t c\u00e1ch chi ti\u1ebft c\u00e1c th\u00f4ng tin v\u1ec1 nh\u1eefng thay \u0111\u1ed5i x\u1ea3y ra \u0111\u1ed1i v\u1edbi m\u00e3 ngu\u1ed3n, Git gi\u00fap c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean trong d\u1ef1 \u00e1n c\u00f3 th\u1ec3 truy xu\u1ea5t l\u1ea1i l\u1ecbch s\u1eed thay \u0111\u1ed5i, ph\u00e1t hi\u1ec7n c\u00e1c nguy\u00ean nh\u00e2n khi h\u1ec7 th\u1ed1ng g\u1eb7p l\u1ed7i.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">H\u1ee3p nh\u1ea5t thay \u0111\u1ed5i t\u1eeb nhi\u1ec1u ngu\u1ed3n: V\u1edbi c\u00e1c t\u00ednh n\u0103ng nh\u01b0 ph\u00e2n nh\u00e1nh v\u00e0 g\u1ed9p nh\u00e1nh (merge, rebase), Git gi\u00fap cho vi\u1ec7c h\u1ee3p nh\u1ea5t c\u00e1c thay \u0111\u1ed5i c\u1ee7a c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean \u0111\u01b0\u1ee3c di\u1ec5n ra m\u1ed9t c\u00e1ch thu\u1eadn ti\u1ec7n v\u00e0 ti\u1ebft ki\u1ec7m th\u1eddi gian h\u01a1n.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">L\u01b0u tr\u1eef v\u00e0 chia s\u1ebb m\u00e3 ngu\u1ed3n: Git h\u1ed7 tr\u1ee3 k\u1ebft n\u1ed1i v\u1edbi c\u00e1c kho l\u01b0u tr\u1eef m\u00e3 ngu\u1ed3n t\u1eeb xa nh\u01b0 Github, Gitlab, Bitbucket. \u0110i\u1ec1u n\u00e0y gi\u00fap b\u1ea3o v\u1ec7 m\u00e3 ngu\u1ed3n an to\u00e0n v\u00e0 thu\u1eadn ti\u1ec7n cho vi\u1ec7c chia s\u1ebb gi\u1eefa c\u00e1c th\u00e0nh vi\u00ean trong nh\u00f3m ho\u1eb7c chia s\u1ebb ra c\u1ed9ng \u0111\u1ed3ng.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">So s\u00e1nh s\u1ef1 thay \u0111\u1ed5i trong phi\u00ean b\u1ea3n: V\u1edbi c\u1ea5u tr\u00fac \u0111\u1eb7c bi\u1ec7t bao g\u1ed3m Staging Area (khu v\u1ef1c trung gian) k\u1ebft h\u1ee3p v\u1edbi l\u1ec7nh \u201cgit diff\u201d, Git gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean c\u00f3 th\u1ec3 ch\u1ecdn l\u1ecdc nh\u1eefng thay \u0111\u1ed5i c\u1ea7n thi\u1ebft tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n l\u01b0u tr\u1eef ch\u00fang v\u00e0o kho l\u01b0u tr\u1eef.<\/span><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-t\u1ea1i-sao-chung-ta-nen-s\u1eed-d\u1ee5ng-git\"><b>T\u1ea1i sao ch\u00fang ta n\u00ean s\u1eed d\u1ee5ng git?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Git \u0111ang ng\u00e0y c\u00e0ng tr\u1edf n\u00ean ph\u1ed5 bi\u1ebfn v\u00e0 c\u00f3 vai tr\u00f2 quan tr\u1ecdng trong ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m b\u1edfi v\u00ec nh\u1eefng l\u1ee3i \u00edch m\u00e0 n\u00f3 mang l\u1ea1i. Vi\u1ec7c s\u1eed d\u1ee5ng Git trong d\u1ef1 \u00e1n s\u1ebd gi\u00fap b\u1ea1n d\u1ec5 d\u00e0ng theo d\u00f5i v\u00e0 qu\u1ea3n l\u00fd c\u00e1c phi\u00ean b\u1ea3n c\u1ee7a m\u00e3 ngu\u1ed3n. T\u1eeb \u0111\u00f3 c\u00f3 th\u1ec3 k\u1ecbp th\u1eddi truy v\u1ebft v\u00e0 ph\u00e1t hi\u1ec7n l\u1ed7i trong qu\u00e1 tr\u00ecnh l\u00e0m vi\u1ec7c. T\u00ednh n\u0103ng ph\u00e2n nh\u00e1nh c\u1ee7a Git s\u1ebd gi\u00fap b\u1ea1n c\u00f3 th\u1ec3 ph\u00e1t tri\u1ec3n, th\u1eed nghi\u1ec7m c\u00e1c t\u00ednh n\u0103ng m\u1edbi m\u00e0 kh\u00f4ng l\u00e0m \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn phi\u00ean b\u1ea3n \u0111ang ho\u1ea1t \u0111\u1ed9ng \u1ed5n \u0111\u1ecbnh c\u1ee7a ph\u1ea7n m\u1ec1m.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u1edbi b\u1ea3n ch\u1ea5t c\u1ee7a m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ph\u00e2n t\u00e1n, Git gi\u00fap vi\u1ec7c c\u1ed9ng t\u00e1c gi\u1eefa c\u00e1c th\u00e0nh vi\u00ean tr\u1edf n\u00ean d\u1ec5 d\u00e0ng h\u01a1n. B\u00ean c\u1ea1nh \u0111\u00f3, Git c\u0169ng \u0111\u1ea3m b\u1ea3o cho vi\u1ec7c l\u01b0u tr\u1eef v\u00e0 ph\u1ee5c h\u1ed3i m\u00e3 ngu\u1ed3n.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-thu\u1eadt-ng\u1eef-c\u01a1-b\u1ea3n-trong-git\"><span class=\"ez-toc-section\" id=\"Cac_thuat_ngu_co_ban_trong_Git\"><\/span><b>C\u00e1c thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n trong Git<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-repository-trong-git\"><b>Repository trong Git<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Repository l\u00e0 n\u01a1i l\u01b0u tr\u1eef t\u1ea5t c\u1ea3 nh\u1eefng th\u00f4ng tin c\u1ee7a m\u00e3 ngu\u1ed3n, bao g\u1ed3m c\u00e1c t\u1eadp tin c\u1ee7a phi\u00ean b\u1ea3n hi\u1ec7n t\u1ea1i, l\u1ecbch s\u1eed thay \u0111\u1ed5i v\u00e0 c\u00e1c th\u00f4ng tin li\u00ean quan kh\u00e1c trong m\u00e3 ngu\u1ed3n. L\u1ecbch s\u1eed thay \u0111\u1ed5i c\u1ee7a c\u00e1c t\u1eadp tin \u0111\u01b0\u1ee3c qu\u1ea3n l\u00fd b\u1eb1ng c\u00e1c \u1ea3nh ch\u1ee5p g\u1ecdi l\u00e0 commit.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">N\u00f3i n\u00f4m na th\u00ec Repository ch\u00ednh l\u00e0 th\u01b0 m\u1ee5c ch\u1ee9a m\u00e3 ngu\u1ed3n m\u00e0 \u1edf \u0111\u00f3 \u0111\u00e3 c\u00f3 kh\u1edfi t\u1ea1o git (s\u1eed d\u1ee5ng \u201cgit init\u201d) v\u00e0 git \u0111ang theo d\u00f5i, qu\u1ea3n l\u00fd c\u00e1c t\u1eadp tin b\u00ean trong \u0111\u00f3.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">C\u00f3 hai lo\u1ea1i Repository ch\u00ednh trong Git:<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><b>Local Repository<\/b><span style=\"font-weight: 400;\">: L\u00e0 kho l\u01b0u tr\u1eef tr\u00ean m\u00e1y t\u00ednh c\u00e1 nh\u00e2n c\u1ee7a l\u1eadp tr\u00ecnh vi\u00ean. N\u00f3 bao g\u1ed3m t\u1ea5t c\u1ea3 c\u00e1c t\u1eadp tin v\u00e0 th\u01b0 m\u1ee5c trong m\u00e3 ngu\u1ed3n. Kho l\u01b0u tr\u1eef n\u00e0y \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 th\u1ef1c hi\u1ec7n c\u00e1c thay \u0111\u1ed5i t\u1ea1i c\u1ee5c b\u1ed9 v\u00e0 xem l\u1ea1i l\u1ecbch s\u1eed m\u00e0 kh\u00f4ng c\u1ea7n k\u1ebft n\u1ed1i internet.<\/span><\/li>\n\n\n\n<li><b>Remote Repository<\/b><span style=\"font-weight: 400;\">: L\u00e0 kho l\u01b0u tr\u1eef tr\u00ean m\u00e1y ch\u1ee7 t\u1eeb xa, \u0111\u01b0\u1ee3c \u0111\u1eb7t \u1edf b\u1ea5t k\u1ef3 \u0111\u00e2u. Kho l\u01b0u tr\u1eef n\u00e0y \u0111\u01b0\u1ee3c xem l\u00e0 n\u01a1i h\u1ee3p nh\u1ea5t c\u00e1c thay \u0111\u1ed5i trong m\u00e3 ngu\u1ed3n t\u1eeb c\u00e1c th\u00e0nh vi\u00ean, c\u0169ng nh\u01b0 l\u00e0 ph\u01b0\u01a1ng ti\u1ec7n \u0111\u1ec3 l\u01b0u tr\u1eef v\u00e0 chia s\u1ebb th\u00f4ng tin m\u00e3 ngu\u1ed3n m\u1ed9t c\u00e1ch an to\u00e0n. C\u00e1c \u0111\u1ea1i di\u1ec7n cung c\u1ea5p d\u1ecbch v\u1ee5 n\u00e0y bao g\u1ed3m Github, Gitlab, Bitbucket, Perforce,&#8230;<\/span><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-lam-vi\u1ec7c-v\u1edbi-commit-branch\"><b>L\u00e0m vi\u1ec7c v\u1edbi Commit, Branch<\/b><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-commit\"><b>Commit<\/b><\/h4>\n\n\n\n<p><span style=\"font-weight: 400;\">Khi c\u1ea7n l\u01b0u l\u1ea1i c\u00e1c thay \u0111\u1ed5i v\u00e0o Repository, ng\u01b0\u1eddi d\u00f9ng c\u1ea7n th\u1ef1c hi\u1ec7n vi\u1ec7c t\u1ea1o ra m\u1ed9t commit. M\u1ed7i commit trong Git l\u00e0 \u0111\u1ea1i di\u1ec7n cho m\u1ed9t phi\u00ean b\u1ea3n c\u1ee7a m\u00e3 ngu\u1ed3n, n\u00f3 bao g\u1ed3m c\u00e1c th\u00f4ng tin sau:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Danh s\u00e1ch c\u00e1c thay \u0111\u1ed5i tr\u00ean c\u00e1c t\u1eadp tin, g\u1ecdi l\u00e0 \u201csnapshot\u201d<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Th\u00f4ng tin c\u1ee7a ng\u01b0\u1eddi t\u1ea1o ra commit v\u00e0 th\u1eddi gian t\u1ea1o<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">M\u00f4 t\u1ea3 c\u1ee7a commit<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-weight: 400;\">Ngo\u00e0i ra, m\u1ed7i commit s\u1ebd \u0111\u01b0\u1ee3c g\u1eafn li\u1ec1n v\u1edbi m\u1ed9t m\u00e3 b\u0103m duy nh\u1ea5t d\u00e0i 40 k\u00fd t\u1ef1 g\u1ecdi l\u00e0 SHA-1. \u0110\u00e2y \u0111\u01b0\u1ee3c xem nh\u01b0 l\u00e0 m\u00e3 \u0111\u1ecbnh danh c\u1ee7a commit \u0111\u00f3 v\u00e0 s\u1ebd kh\u00f4ng c\u00f3 hai SHA-1 n\u00e0o tr\u00f9ng nhau trong m\u1ed9t m\u00e3 ngu\u1ed3n.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-branch\"><b>Branch<\/b><\/h4>\n\n\n\n<p><span style=\"font-weight: 400;\">Branch (hay c\u00f2n g\u1ecdi l\u00e0 Nh\u00e1nh) trong Git l\u00e0 m\u1ed9t t\u1eadp h\u1ee3p c\u00e1c commit, n\u00f3 nh\u01b0 l\u00e0 m\u1ed9t phi\u00ean b\u1ea3n l\u1edbn trong m\u00e3 ngu\u1ed3n. Trong m\u1ed9t repository, ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 t\u1ea1o ra nhi\u1ec1u nh\u00e1nh \u0111\u1ec3 thu\u1eadn ti\u1ec7n trong vi\u1ec7c qu\u1ea3n l\u00fd c\u00e1c phi\u00ean b\u1ea3n.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">M\u1eb7c \u0111\u1ecbnh khi kh\u1edfi t\u1ea1o Git, Repository s\u1ebd c\u00f3 m\u1ed9t nh\u00e1nh ban \u0111\u1ea7u t\u00ean l\u00e0 \u201cmain\u201d (\u1edf c\u00e1c phi\u00ean b\u1ea3n Git c\u0169, n\u00f3 c\u00f3 t\u00ean l\u00e0 master). Khi ng\u01b0\u1eddi d\u00f9ng th\u1ef1c hi\u1ec7n commit, n\u00f3 s\u1ebd \u0111\u01b0\u1ee3c g\u00e1n cho nh\u00e1nh m\u00e0 ng\u01b0\u1eddi d\u00f9ng \u0111ang l\u00e0m vi\u1ec7c. Ngo\u00e0i ra, khi m\u1ed9t nh\u00e1nh kh\u00e1c \u0111\u01b0\u1ee3c t\u1ea1o ra, n\u00f3 s\u1ebd k\u1ebf th\u1eeba t\u1ea5t c\u1ea3 c\u00e1c commit c\u00f3 trong nh\u00e1nh ban \u0111\u1ea7u, \u0111\u00e2y g\u1ecdi l\u00e0 ph\u00e2n nh\u00e1nh.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, m\u1ed9t repository c\u00f3 nh\u00e1nh \u201cmain\u201d v\u1edbi ba commit l\u00e0 A, B, C. Ng\u01b0\u1eddi d\u00f9ng ti\u1ebfn h\u00e0nh t\u00e1ch m\u1ed9t nh\u00e1nh m\u1edbi l\u00e0 \u201cdevelop\u201d. Nh\u00e1nh n\u00e0y c\u0169ng s\u1ebd c\u00f3 ba commit ban \u0111\u1ea7u l\u00e0 A, B, C. Ti\u1ebfp theo ng\u01b0\u1eddi d\u00f9ng chuy\u1ec3n sang l\u00e0m vi\u1ec7c tr\u00ean nh\u00e1nh develop, v\u00e0 th\u1ef1c hi\u1ec7n t\u1ea1o ra commit D. Th\u00ec l\u00fac n\u00e0y, nh\u00e1nh develop s\u1ebd c\u00f3 b\u1ed1n commit, tuy nhi\u00ean nh\u00e1nh \u201cmain\u201d v\u1eabn s\u1ebd gi\u1eef nguy\u00ean l\u00e0 ba commit A, B, C.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"795\" height=\"230\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-branch-vippro.png\" alt=\"git l\u00e0 g\u00ec - git branch - itviec blog\" class=\"wp-image-81615\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-branch-vippro.png 795w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-branch-vippro-300x87.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-branch-vippro-700x203.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-branch-vippro-200x58.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-branch-vippro-100x29.png 100w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cac-thu\u1eadt-ng\u1eef-quan-tr\u1ecdng-khac-trong-git\"><b>C\u00e1c thu\u1eadt ng\u1eef quan tr\u1ecdng kh\u00e1c trong git<\/b><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><b>Branch<\/b><\/td><td><span style=\"font-weight: 400;\">M\u1ed7i nh\u00e1nh l\u01b0u tr\u1eef m\u1ed9t d\u00f2ng l\u1ecbch s\u1eed commit ri\u00eang trong kho l\u01b0u tr\u1eef, c\u00f3 th\u1ec3 t\u00e1ch th\u00e0nh nhi\u1ec1u nh\u00e1nh v\u00e0 h\u1ee3p nh\u1ea5t nh\u00e1nh<\/span><\/td><\/tr><tr><td><b>Checkout<\/b><\/td><td><span style=\"font-weight: 400;\">L\u1ec7nh d\u00f9ng \u0111\u1ec3 chuy\u1ec3n \u0111\u1ed5i gi\u1eefa c\u00e1c nh\u00e1nh ho\u1eb7c c\u00e1c phi\u00ean b\u1ea3n c\u1ee5 th\u1ec3 c\u00f3 trong repository<\/span><\/td><\/tr><tr><td><b>HEAD<\/b><\/td><td><span style=\"font-weight: 400;\">\u0110\u1ea1i di\u1ec7n cho commit m\u1edbi nh\u1ea5t trong nh\u00e1nh l\u00e0m vi\u1ec7c hi\u1ec7n t\u1ea1i. Khi c\u00f3 m\u1ed9t commit m\u1edbi \u0111\u01b0\u1ee3c t\u1ea1o ra, HEAD s\u1ebd tr\u1edf th\u00e0nh commit \u0111\u00f3.<\/span><\/td><\/tr><tr><td><b>Merge<\/b><\/td><td><span style=\"font-weight: 400;\">K\u1ebft h\u1ee3p c\u00e1c thay \u0111\u1ed5i t\u1eeb nh\u00e1nh n\u00e0y v\u00e0o m\u1ed9t nh\u00e1nh kh\u00e1c b\u1eb1ng c\u00e1ch h\u1ee3p nh\u1ea5t l\u1ecbch s\u1eed commit, th\u01b0\u1eddng s\u1ebd t\u1ea1o ra m\u1ed9t commit m\u1edbi v\u1edbi n\u1ed9i dung k\u1ebft h\u1ee3p trong nh\u00e1nh \u0111\u01b0\u1ee3c merge<\/span><\/td><\/tr><tr><td><b>Rebase<\/b><\/td><td><span style=\"font-weight: 400;\">Kh\u00e1c v\u1edbi Merge, tuy nhi\u00ean Rebase s\u1ebd s\u1eafp x\u1ebfp l\u1ea1i c\u00e1c commit t\u1eeb hai nh\u00e1nh theo h\u01b0\u1edbng tuy\u1ebfn t\u00ednh \u0111\u1ec3 h\u1ee3p nh\u1ea5t 2 nh\u00e1nh, v\u00e0 kh\u00f4ng t\u1ea1o ra commit Merge<\/span><\/td><\/tr><tr><td><b>Conflict<\/b><\/td><td><span style=\"font-weight: 400;\">L\u00e0 xung \u0111\u1ed9t gi\u1eefa c\u00e1c thay \u0111\u1ed5i tr\u00ean c\u00f9ng m\u1ed9t t\u1eadp tin khi ti\u1ebfn h\u00e0nh h\u1ee3p nh\u1ea5t c\u00e1c nh\u00e1nh<\/span><\/td><\/tr><tr><td><b>Origin<\/b><\/td><td><span style=\"font-weight: 400;\">T\u00ean m\u1eb7c \u0111\u1ecbnh \u0111\u01b0\u1ee3c Git s\u1eed d\u1ee5ng \u0111\u1ec3 ch\u1ec9 remote repository \u0111\u00e3 k\u1ebft n\u1ed1i v\u1edbi repository c\u1ee5c b\u1ed9. N\u00f3 ch\u1ee9a th\u00f4ng tin \u0111\u1ecba ch\u1ec9 c\u1ee7a kho l\u01b0u tr\u1eef t\u1eeb xa<\/span><\/td><\/tr><tr><td><b>Clone<\/b><\/td><td><span style=\"font-weight: 400;\">L\u00e0 qu\u00e1 tr\u00ecnh sao ch\u00e9p to\u00e0n b\u1ed9 n\u1ed9i dung repository t\u1eeb kho l\u01b0u tr\u1eef t\u1eeb xa v\u1ec1 m\u00e1y c\u1ee5c b\u1ed9<\/span><\/td><\/tr><tr><td><b>Push<\/b><\/td><td><span style=\"font-weight: 400;\">C\u1eadp nh\u1eadt c\u00e1c commit m\u1edbi t\u1eeb kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9 \u0111\u1ebfn kho l\u01b0u tr\u1eef t\u1eeb xa<\/span><\/td><\/tr><tr><td><b>Fetch<\/b><\/td><td><span style=\"font-weight: 400;\">L\u1ea5y c\u00e1c commit thay \u0111\u1ed5i t\u1eeb kho l\u01b0u tr\u1eef t\u1eeb xa nh\u01b0ng kh\u00f4ng ti\u1ebfn h\u00e0nh h\u1ee3p nh\u1ea5t v\u1edbi nh\u00e1nh \u0111ang l\u00e0m vi\u1ec7c<\/span><\/td><\/tr><tr><td><b>Pull<\/b><\/td><td><span style=\"font-weight: 400;\">L\u00e0 s\u1ef1 k\u1ebft h\u1ee3p gi\u1eefa fetch v\u00e0 merge \u0111\u1ed1i v\u1edbi nh\u00e1nh \u0111ang l\u00e0m vi\u1ec7c<\/span><\/td><\/tr><tr><td><b>Tag<\/b><\/td><td><span style=\"font-weight: 400;\">\u0110\u00e1nh d\u1ea5u m\u1ed9t phi\u00ean b\u1ea3n c\u1ee5 th\u1ec3 c\u1ee7a d\u1ef1 \u00e1n, c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng Checkout \u0111\u1ec3 chuy\u1ec3n \u0111\u1ebfn phi\u00ean b\u1ea3n n\u00e0y. Th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 ph\u00e1t h\u00e0nh c\u00e1c phi\u00ean b\u1ea3n ch\u00ednh th\u1ee9c c\u1ee7a ph\u1ea7n m\u1ec1m<\/span><\/td><\/tr><tr><td><b>Git config<\/b><\/td><td><span style=\"font-weight: 400;\">Thi\u1ebft l\u1eadp c\u00e1c c\u1ea5u h\u00ecnh cho Git nh\u01b0 th\u00f4ng tin ng\u01b0\u1eddi d\u00f9ng, tr\u00ecnh so\u1ea1n th\u1ea3o m\u1eb7c \u0111\u1ecbnh,&#8230;<\/span><\/td><\/tr><tr><td><b>Cherry-pick<\/b><\/td><td><span style=\"font-weight: 400;\">Sao ch\u00e9p m\u1ed9t commit t\u1eeb nh\u00e1nh kh\u00e1c m\u00e0 kh\u00f4ng c\u1ea7n ph\u1ea3i g\u1ed9p nh\u00e1nh<\/span><\/td><\/tr><tr><td><b>Fork<\/b><\/td><td><span style=\"font-weight: 400;\">T\u1ea1o ra m\u1ed9t b\u1ea3n sao repository \u0111\u1ed9c l\u1eadp t\u1eeb m\u1ed9t ngu\u1ed3n kh\u00e1c<\/span><\/td><\/tr><tr><td><b>.gitignore<\/b><\/td><td><span style=\"font-weight: 400;\">D\u00f9ng \u0111\u1ec3 li\u1ec7t k\u00ea c\u00e1c file mu\u1ed1n <\/span><span style=\"font-weight: 400;\">kh\u00f4ng <\/span><span style=\"font-weight: 400;\">Git theo d\u00f5i v\u00e0 Git s\u1ebd b\u1ecf qua m\u1ecdi thay \u0111\u1ed5i trong c\u00e1c file \u0111\u00f3<\/span><\/td><\/tr><tr><td><b>Git flow<\/b><\/td><td><span style=\"font-weight: 400;\">L\u00e0 quy tr\u00ecnh l\u00e0m vi\u1ec7c (workflow) trong Git, \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 gi\u00fap qu\u1ea3n l\u00fd c\u00e1c d\u1ef1 \u00e1n c\u00f3 v\u00f2ng \u0111\u1eddi ph\u00e1t tri\u1ec3n d\u00e0i v\u00e0 ph\u1ee9c t\u1ea1p.<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-nguyen-ly-ho\u1ea1t-d\u1ed9ng-c\u1ee7a-git\"><span class=\"ez-toc-section\" id=\"Nguyen_ly_hoat_dong_cua_git\"><\/span><b>Nguy\u00ean l\u00fd ho\u1ea1t \u0111\u1ed9ng c\u1ee7a git<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cach-git-qu\u1ea3n-ly-cac-phien-b\u1ea3n\"><b>C\u00e1ch git qu\u1ea3n l\u00fd c\u00e1c phi\u00ean b\u1ea3n<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">S\u1ef1 kh\u00e1c bi\u1ec7t ch\u00ednh gi\u1eefa Git v\u1edbi c\u00e1c VCS kh\u00e1c \u0111\u00f3 ch\u00ednh l\u00e0 c\u00e1ch Git \u201cngh\u0129\u201d v\u1ec1 d\u1eef li\u1ec7u c\u1ee7a n\u00f3. V\u1ec1 m\u1eb7t kh\u00e1i ni\u1ec7m, h\u1ea7u h\u1ebft c\u00e1c h\u1ec7 th\u1ed1ng VCS kh\u00e1c l\u01b0u tr\u1eef th\u00f4ng tin d\u01b0\u1edbi d\u1ea1ng danh s\u00e1ch c\u00e1c thay \u0111\u1ed5i d\u1ef1a tr\u00ean t\u1eadp tin. Ch\u00fang coi th\u00f4ng tin l\u01b0u tr\u1eef l\u00e0 m\u1ed9t t\u1eadp h\u1ee3p c\u00e1c t\u1eadp tin v\u00e0 c\u00e1c thay \u0111\u1ed5i \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n \u0111\u1ed1i v\u1edbi t\u1eebng t\u1eadp tin theo th\u1eddi gian.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ed1i v\u1edbi Git, d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c qu\u1ea3n l\u00fd b\u1eb1ng c\u00e1c phi\u00ean b\u1ea3n \u201c\u1ea3nh ch\u1ee5p\u201d nhanh (snapshot). M\u1ed7i khi c\u00f3 m\u1ed9t Commit \u0111\u01b0\u1ee3c l\u01b0u v\u00e0o kho l\u01b0u tr\u1eef, Git s\u1ebd ch\u1ee5p \u1ea3nh t\u1ea5t c\u1ea3 c\u00e1c t\u1eadp tin trong m\u00e3 ngu\u1ed3n tr\u00f4ng nh\u01b0 th\u1ebf n\u00e0o t\u1ea1i th\u1eddi \u0111i\u1ec3m \u0111\u00f3 v\u00e0 l\u01b0u tr\u1eef tham chi\u1ebfu \u0111\u1ebfn \u1ea3nh ch\u1ee5p nhanh \u0111\u00f3.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong m\u1ed9t phi\u00ean b\u1ea3n n\u1ebfu c\u00f3 t\u1eadp tin n\u00e0o kh\u00f4ng thay \u0111\u1ed5i, Git s\u1ebd kh\u00f4ng l\u01b0u tr\u1eef l\u1ea1i m\u00e0 ch\u1ec9 l\u01b0u tr\u1eef li\u00ean k\u1ebft \u0111\u1ebfn t\u1eadp tin gi\u1ed1ng h\u1ec7t tr\u01b0\u1edbc \u0111\u00f3 m\u00e0 n\u00f3 \u0111\u00e3 l\u01b0u tr\u1eef trong Repository. \u0110i\u1ec1u n\u00e0y gi\u00fap Git t\u1ed1i \u01b0u h\u00f3a vi\u1ec7c l\u01b0u tr\u1eef v\u00e0 qu\u1ea3n l\u00fd.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"469\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-nguyen-ly-lam-viec-vippro.png\" alt=\"git l\u00e0 g\u00ec - nguy\u00ean l\u00fd l\u00e0m vi\u1ec7c c\u1ee7a git - itviec blog\" class=\"wp-image-81614\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-nguyen-ly-lam-viec-vippro.png 866w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-nguyen-ly-lam-viec-vippro-300x162.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-nguyen-ly-lam-viec-vippro-700x379.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-nguyen-ly-lam-viec-vippro-200x108.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-nguyen-ly-lam-viec-vippro-100x54.png 100w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-c\u1ea5u-truc-2-cay\"><b>C\u1ea5u tr\u00fac 2 c\u00e2y<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ed1i v\u1edbi c\u00e1c h\u1ec7 th\u1ed1ng VCS th\u00f4ng th\u01b0\u1eddng, ch\u00fang s\u1ebd ho\u1ea1t \u0111\u1ed9ng d\u1ef1a tr\u00ean hai khu v\u1ef1c ri\u00eang bi\u1ec7t bao g\u1ed3m:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Working Space: Khu v\u1ef1c l\u00e0m vi\u1ec7c, n\u01a1i m\u00e0 l\u1eadp tr\u00ecnh vi\u00ean th\u1ef1c hi\u1ec7n c\u00e1c thay \u0111\u1ed5i.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Repository: N\u01a1i l\u01b0u tr\u1eef m\u00e3 ngu\u1ed3n v\u00e0 c\u00e1c phi\u00ean b\u1ea3n.<\/span><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"154\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-2-cay-vippro.png\" alt=\"git l\u00e0 g\u00ec - m\u00f4 h\u00ecnh c\u1ea5u tr\u00fac 2 c\u00e2y - itviec blog\" class=\"wp-image-81616\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-2-cay-vippro.png 412w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-2-cay-vippro-300x112.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-2-cay-vippro-200x75.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-2-cay-vippro-100x37.png 100w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u00e2y g\u1ecdi l\u00e0 c\u1ea5u tr\u00fac 2 c\u00e2y. V\u1ec1 quy tr\u00ecnh ho\u1ea1t \u0111\u1ed9ng, ng\u01b0\u1eddi d\u00f9ng ch\u1ec9 c\u00f3 th\u1ec3 ch\u1ec9nh s\u1eeda c\u00e1c t\u1eadp tin \u0111\u01b0\u1ee3c n\u1eb1m trong Working Space, m\u00e0 kh\u00f4ng th\u1ec3 tr\u1ef1c ti\u1ebfp l\u1ea5y v\u00e0 ch\u1ec9nh s\u1eeda t\u1ea5t c\u1ea3 c\u00e1c t\u1eadp tin \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong Repository.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 c\u00f3 th\u1ec3 truy c\u1eadp v\u00e0 ch\u1ec9nh s\u1eeda nh\u1eefng t\u1eadp tin kh\u00e1c c\u00f3 trong Repository, ng\u01b0\u1eddi d\u00f9ng c\u1ea7n th\u1ef1c hi\u1ec7n h\u00e0nh \u0111\u1ed9ng Check-out (l\u1ea5y c\u00e1c t\u1eadp tin t\u1eeb Repository \u0111\u01b0a v\u00e0o Working Space). Sau khi ch\u1ec9nh s\u1eeda, ng\u01b0\u1eddi d\u00f9ng c\u1ea7n th\u1ef1c hi\u1ec7n Commit (cam k\u1ebft) \u0111\u1ec3 l\u01b0u t\u1eadp tin \u0111\u00e3 thay \u0111\u1ed5i v\u00e0o l\u1ea1i Repository.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Nh\u01b0\u1ee3c \u0111i\u1ec3m c\u1ee7a c\u1ea5u tr\u00fac n\u00e0y l\u00e0 c\u00f3 th\u1ec3 g\u00e2y kh\u00f3 kh\u0103n trong vi\u1ec7c qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n \u0111\u1ed1i v\u1edbi c\u00e1c d\u1ef1 \u00e1n l\u1edbn, c\u00f3 nhi\u1ec1u t\u1eadp tin v\u00e0 c\u1ea7n thay \u0111\u1ed5i gi\u1eefa c\u00e1c phi\u00ean b\u1ea3n m\u1ed9t c\u00e1ch th\u01b0\u1eddng xuy\u00ean. M\u1ed9t \u0111\u1ea1i di\u1ec7n n\u1ed5i b\u1eadt v\u1ec1 vi\u1ec7c s\u1eed d\u1ee5ng c\u1ea5u tr\u00fac 2 c\u00e2y n\u00e0y ch\u00ednh l\u00e0 Subversion (SVN).<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-c\u1ea5u-truc-3-cay\"><b>C\u1ea5u tr\u00fac 3 c\u00e2y<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 kh\u1eafc ph\u1ee5c c\u00e1c b\u1ea5t c\u1eadp c\u1ee7a c\u1ea5u tr\u00fac 2 c\u00e2y, Git \u0111\u00e3 s\u1eed d\u1ee5ng m\u1ed9t c\u1ea5u tr\u00fac \u0111\u1eb7c bi\u1ec7t h\u01a1n, \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 c\u1ea5u tr\u00fac 3 c\u00e2y. V\u1ec1 b\u1ea3n ch\u1ea5t, Git v\u1eabn gi\u1eef hai th\u00e0nh ph\u1ea7n ch\u00ednh l\u00e0 Repository v\u00e0 WorkingSpace, tuy nhi\u00ean Git \u0111\u00e3 b\u1ed5 sung m\u1ed9t th\u00e0nh ph\u1ea7n trung gian g\u1ecdi l\u00e0 Staging (hay c\u00f2n g\u1ecdi l\u00e0 Index).<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"202\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-3-cay-vippro.png\" alt=\"git l\u00e0 g\u00ec - m\u00f4 h\u00ecnh c\u1ea5u tr\u00fac 3 c\u00e2y - itviec blog\" class=\"wp-image-81617\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-3-cay-vippro.png 688w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-3-cay-vippro-300x88.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-3-cay-vippro-640x188.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-3-cay-vippro-200x59.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-la-gi-mo-hinh-3-cay-vippro-100x29.png 100w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">Khi ng\u01b0\u1eddi d\u00f9ng mu\u1ed1n l\u01b0u tr\u1eef nh\u1eefng thay \u0111\u1ed5i tr\u00ean t\u1eadp tin, \u0111\u1ea7u ti\u00ean c\u1ea7n ph\u1ea3i \u0111\u01b0a nh\u1eefng thay \u0111\u1ed5i n\u00e0y v\u00e0o Staging b\u1eb1ng l\u1ec7nh Add, sau \u0111\u00f3 s\u1ebd th\u1ef1c hi\u1ec7n m\u1ed9t l\u1ec7nh Commit \u0111\u1ec3 ch\u00ednh th\u1ee9c l\u01b0u ch\u00fang v\u00e0o Repository.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ec v\u1eady, Staging \u0111\u01b0\u1ee3c xem l\u00e0 n\u01a1i m\u00e0 ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 xem x\u00e9t l\u1ea1i to\u00e0n b\u1ed9 c\u00e1c thay \u0111\u1ed5i c\u1ee7a m\u00ecnh tr\u01b0\u1edbc khi l\u01b0u tr\u1eef v\u00e0o Repository v\u00e0 c\u00f3 th\u1ec3 ki\u1ec3m so\u00e1t \u0111\u01b0\u1ee3c nh\u1eefng th\u00f4ng tin n\u00e0o s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong m\u1ed9t phi\u00ean b\u1ea3n.<\/span><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><span style=\"font-weight: 400;\">L\u1ea5y v\u00ed d\u1ee5, b\u1ea1n \u0111ang th\u1ef1c hi\u1ec7n ch\u1ec9nh s\u1eeda tr\u00ean t\u1eadp tin A, s\u1ebfp g\u1eedi y\u00eau c\u1ea7u b\u1ea1n h\u00e3y b\u1ed5 sung th\u00eam n\u1ed9i dung \u1edf t\u1eadp tin B.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u00fac n\u00e0y, trong tr\u01b0\u1eddng h\u1ee3p c\u00e1c VCS c\u00f3 c\u1ea5u tr\u00fac 2 c\u00e2y, n\u1ebfu b\u1ea1n th\u1ef1c hi\u1ec7n Commit \u0111\u1ec3 l\u01b0u tr\u1eef thay \u0111\u1ed5i v\u00e0o Repository, th\u00ec c\u1ea3 hai thay \u0111\u1ed5i tr\u00ean t\u1eadp tin A v\u00e0 t\u1eadp tin B \u0111\u1ec1u s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u l\u1ea1i th\u00e0nh m\u1ed9t phi\u00ean b\u1ea3n.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Tho\u1ea1t nh\u00ecn s\u1ebd th\u1ea5y \u0111i\u1ec1u n\u00e0y r\u1ea5t b\u00ecnh th\u01b0\u1eddng, tuy nhi\u00ean n\u1ebfu x\u00e9t trong m\u1ed9t h\u1ec7 th\u1ed1ng l\u1edbn v\u1edbi r\u1ea5t nhi\u1ec1u phi\u00ean b\u1ea3n, th\u00ec \u0111\u00e2y c\u00f3 th\u1ec3 s\u1ebd l\u00e0 m\u1ed9t qu\u1ea3 bom n\u1ed5 ch\u1eadm khi c\u00f3 l\u1ed7i x\u1ea3y ra v\u00e0 c\u1ea7n \u0111i\u1ec1u tra l\u1ea1i l\u1ecbch s\u1eed thay \u0111\u1ed5i.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Thay v\u00e0o \u0111\u00f3, khi s\u1eed d\u1ee5ng Git, b\u1ea1n c\u00f3 th\u1ec3 \u0111\u01b0a thay \u0111\u1ed5i c\u1ee7a t\u1eadp tin A v\u00e0o Staging, v\u00e0 th\u1ef1c hi\u1ec7n commit l\u1ea7n 1. Sau \u0111\u00f3 ti\u1ebfp t\u1ee5c \u0111\u01b0a thay \u0111\u1ed5i t\u1eeb t\u1eadp tin B v\u00e0o Staging v\u00e0 th\u1ef1c hi\u1ec7n commit l\u1ea7n 2. <\/span><span style=\"font-weight: 400;\">\u0110i\u1ec1u n\u00e0y gi\u00fap t\u00e1ch bi\u1ec7t hai phi\u00ean b\u1ea3n kh\u00f4ng li\u00ean quan \u0111\u1ebfn nhau, v\u00e0 d\u1ec5 d\u00e0ng cho vi\u1ec7c truy v\u1ebft l\u1ecbch s\u1eed thay \u0111\u1ed5i trong m\u00e3 ngu\u1ed3n.<\/span><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-h\u01b0\u1edbng-d\u1eabn-cach-cai-d\u1eb7t-va-c\u1ea5u-hinh-git\"><span class=\"ez-toc-section\" id=\"Huong_dan_cach_cai_dat_va_cau_hinh_Git\"><\/span><b>H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh Git<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ed1i v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh MacOS, Git c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t b\u1eb1ng terminal v\u1edbi l\u1ec7nh:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">brew install git<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Truy c\u1eadp <\/span><a href=\"https:\/\/brew.sh\/\"><span style=\"font-weight: 400;\">https:\/\/brew.sh\/<\/span><\/a><span style=\"font-weight: 400;\"> n\u1ebfu b\u1ea1n ch\u01b0a c\u00e0i \u0111\u1eb7t homebrew.<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">\u0110\u1ed1i v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh Windows, ng\u01b0\u1eddi d\u00f9ng truy c\u1eadp \u0111\u01b0\u1eddng d\u1eabn sau \u0111\u1ec3 t\u1ea3i xu\u1ed1ng phi\u00ean b\u1ea3n Gi: <\/span><a href=\"https:\/\/git-scm.com\/downloads\/win\"><span style=\"font-weight: 400;\">https:\/\/git-scm.com\/downloads\/win<\/span><\/a><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">\u0110\u1ed1i v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh Linux, s\u1eed d\u1ee5ng apt \u0111\u1ec3 c\u00e0i \u0111\u1eb7t Git v\u1edbi l\u1ec7nh:<\/span><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">sudo apt-get install git<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Sau khi c\u00e0i \u0111\u1eb7t, b\u1ea1n c\u00f3 th\u1ec3 ki\u1ec3m tra th\u00f4ng tin Git b\u1eb1ng l\u1ec7nh:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git --version<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 c\u00e0i \u0111\u1eb7t th\u00f4ng tin ng\u01b0\u1eddi d\u00f9ng (th\u00f4ng tin n\u00e0y s\u1ebd \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng l\u00e0m th\u00f4ng tin t\u00e1c gi\u1ea3 c\u1ea3 c\u00e1c commit):<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git config --global user.name \"Your Name\"<\/span>\n<span style=\"font-weight: 400;\">git config --global user.email \"youremail@example.com\"<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ki\u1ec3m tra c\u1ea5u h\u00ecnh hi\u1ec7n t\u1ea1i:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git config --list<\/span><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-cau-h\u1ecfi-th\u01b0\u1eddng-g\u1eb7p-v\u1ec1-git-la-gi\"><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_thuong_gap_ve_Git_la_gi\"><\/span><b>C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Git l\u00e0 g\u00ec<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cac-kho-l\u01b0u-tr\u1eef-t\u1eeb-xa-remote-repository-ph\u1ed5-bi\u1ebfn-hi\u1ec7n-nay\"><b>C\u00e1c kho l\u01b0u tr\u1eef t\u1eeb xa (remote repository) ph\u1ed5 bi\u1ebfn hi\u1ec7n nay?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Sau \u0111\u00e2y l\u00e0 m\u1ed9t s\u1ed1 kho l\u01b0u tr\u1eef t\u1eeb xa ph\u1ed5 bi\u1ebfn m\u00e0 c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean \u01b0a chu\u1ed9ng:<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\"><strong>GitHub<\/strong> (<\/span><a href=\"https:\/\/github.com\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/github.com<\/span><\/a><span style=\"font-weight: 400;\">):<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">N\u1eb1m trong top c\u00e1c n\u1ec1n t\u1ea3ng \u0111\u01b0\u1ee3c l\u1eadp tr\u00ecnh vi\u00ean s\u1eed d\u1ee5ng nhi\u1ec1u nh\u1ea5t. Github h\u1ed7 tr\u1ee3 l\u01b0u tr\u1eef m\u00e3 ngu\u1ed3n \u1edf d\u1ea1ng c\u00f4ng khai v\u00e0 ri\u00eang t\u01b0, c\u00f3 th\u1ec3 ph\u00f9 h\u1ee3p v\u1edbi c\u00e1c d\u1ef1 \u00e1n m\u00e3 ngu\u1ed3n m\u1edf ho\u1eb7c nh\u1eefng d\u1ef1 \u00e1n ri\u00eang c\u1ee7a doanh nghi\u1ec7p.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">K\u1ebft h\u1ee3p v\u1edbi Github Actions \u0111\u1ec3 cung c\u1ea5p t\u00ednh n\u0103ng CI\/CD<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">T\u00ednh n\u0103ng Pull Request c\u1ee7a Github l\u00e0 \u0111i\u1ec3m n\u1ed5i b\u1eadt, gi\u00fap thu\u1eadn ti\u1ec7n trong vi\u1ec7c c\u1ed9ng t\u00e1c gi\u1eefa c\u00e1c th\u00e0nh vi\u00ean<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-weight: 400;\"><strong>GitLab<\/strong> (<\/span><a href=\"https:\/\/gitlab.com\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/gitlab.com<\/span><\/a><span style=\"font-weight: 400;\">):<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">L\u00e0 n\u1ec1n t\u1ea3ng t\u00edch h\u1ee3p qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n t\u1eeb xa v\u00e0 c\u1ea3 DevOps<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Th\u00edch h\u1ee3p \u0111\u1ec3 qu\u1ea3n l\u00fd m\u00e3 \u1edf quy m\u00f4 l\u1edbn<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00f3 t\u00edch h\u1ee3p s\u1eb5n CI\/CD trong h\u1ec7 th\u1ed1ng<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-weight: 400;\"><strong>BitBucket<\/strong> (<\/span><a href=\"https:\/\/bitbucket.org\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/bitbucket.org<\/span><\/a><span style=\"font-weight: 400;\">):<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">M\u1ed9t c\u00f4ng c\u1ee5 \u0111\u01b0\u1ee3c cung c\u1ea5p b\u1edfi Atlassian, h\u1ed7 tr\u1ee3 Git v\u00e0 Mercurial<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 t\u00edch h\u1ee3p v\u00e0o c\u00e1c c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd d\u1ef1 \u00e1n nh\u01b0 Trello, Jira<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">T\u00edch h\u1ee3p CI\/CD th\u00f4ng qua Pipelines<\/span><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cac-l\u01b0u-y-c\u1ea7n-bi\u1ebft-khi-lam-vi\u1ec7c-v\u1edbi-git\"><b>C\u00e1c l\u01b0u \u00fd c\u1ea7n bi\u1ebft khi l\u00e0m vi\u1ec7c v\u1edbi Git?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 l\u00e0m vi\u1ec7c v\u1edbi Git m\u1ed9t c\u00e1ch thu\u1eadn l\u1ee3i v\u00e0 c\u00f3 hi\u1ec7u qu\u1ea3, b\u1ea1n c\u1ea7n trang b\u1ecb cho m\u00ecnh nh\u1eefng ki\u1ebfn th\u1ee9c t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao v\u1ec1 Git. \u0110i\u1ec1u n\u00e0y c\u0169ng gi\u00fap b\u1ea1n tr\u00e1nh \u0111\u01b0\u1ee3c nh\u1eefng sai l\u1ea7m c\u00f3 th\u1ec3 g\u00e2y \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn d\u1ef1 \u00e1n.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">D\u01b0\u1edbi \u0111\u00e2y l\u00e0 m\u1ed9t s\u1ed1 l\u01b0u \u00fd b\u1ea1n c\u1ea7n n\u1eafm khi l\u00e0m vi\u1ec7c v\u1edbi Git:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">\u0110\u1ea3m b\u1ea3o \u0111\u00e3 thi\u1ebft l\u1eadp user name v\u00e0 email \u0111\u00fang \u0111\u1ec3 x\u00e1c \u0111\u1ecbnh ng\u01b0\u1eddi d\u00f9ng trong c\u00e1c commit<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng <\/span><b>.gitignore <\/b><span style=\"font-weight: 400;\">\u0111\u1ec3 lo\u1ea1i b\u1ecf nh\u1eefng file ch\u1ee9a n\u1ed9i dung nh\u1ea1y c\u1ea3m kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p l\u01b0u tr\u1eef v\u00e0o repository nh\u01b0 n\u1ed9i dung bi\u1ebfn m\u00f4i tr\u01b0\u1eddng, kh\u00f3a b\u00ed m\u1eadt,&#8230;<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Khi c\u00f3 xung \u0111\u1ed9t (Conflict) x\u1ea3y ra, c\u1ea7n trao \u0111\u1ed5i k\u1ef9 c\u00e0ng v\u1edbi ng\u01b0\u1eddi c\u1ed9ng t\u00e1c \u0111\u1ec3 l\u1ef1a ch\u1ecdn n\u1ed9i dung merge ch\u00ednh x\u00e1c<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Tr\u00e1nh s\u1eed d\u1ee5ng push \u2013force khi l\u00e0m vi\u1ec7c tr\u00ean c\u00e1c nh\u00e1nh c\u00f3 nhi\u1ec1u ng\u01b0\u1eddi c\u1ed9ng t\u00e1c<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">T\u1ea1o commit th\u01b0\u1eddng xuy\u00ean \u0111\u1ec3 tr\u00e1nh c\u00f3 s\u1ef1 c\u1ed1 d\u1eabn \u0111\u1ebfn m\u1ea5t code<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">\u0110\u1eb7t l\u1eddi nh\u1eafn r\u00f5 r\u00e0ng khi t\u1ea1o commit \u0111\u1ec3 thu\u1eadn ti\u1ec7n cho vi\u1ec7c theo d\u00f5i l\u1ecbch s\u1eed v\u00e0 qu\u1ea3n l\u00fd commit<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Tr\u00e1nh g\u1ed9p chung qu\u00e1 nhi\u1ec1u file thay \u0111\u1ed5i v\u1edbi nhi\u1ec1u m\u1ee5c \u0111\u00edch kh\u00e1c nhau tr\u00ean c\u00f9ng m\u1ed9t commit. \u0110i\u1ec1u n\u00e0y s\u1ebd d\u1eabn \u0111\u1ebfn kh\u00f3 kh\u0103n khi c\u1ea7n th\u1ef1c hi\u1ec7n revert m\u1ed9t n\u1ed9i dung trong \u0111\u00f3<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u1eadp nh\u1eadt n\u1ed9i dung nh\u00e1nh t\u1eeb remote repository th\u01b0\u1eddng xuy\u00ean tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n push \u0111\u1ec3 tr\u00e1nh xung \u0111\u1ed9t<\/span><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-m\u1ed9t-s\u1ed1-l\u1ec7nh-c\u01a1-b\u1ea3n-trong-git-la-gi\"><b>M\u1ed9t s\u1ed1 l\u1ec7nh c\u01a1 b\u1ea3n trong Git l\u00e0 g\u00ec?<\/b><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><span style=\"font-weight: 400;\">git clone<\/span><\/td><td><span style=\"font-weight: 400;\">Sao ch\u00e9p m\u1ed9t repository hi\u1ec7n c\u00f3 t\u1eeb kho l\u01b0u tr\u1eef t\u1eeb xa v\u1ec1 c\u1ee5c b\u1ed9<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git init<\/span><\/td><td><span style=\"font-weight: 400;\">Kh\u1edfi t\u1ea1o m\u1ed9t kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git branch&nbsp;<\/span><\/td><td><span style=\"font-weight: 400;\">T\u1ea1o m\u1ed9t nh\u00e1nh l\u00e0m vi\u1ec7c m\u1edbi<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git checkout<\/span><\/td><td><span style=\"font-weight: 400;\">Chuy\u1ec3n tr\u1ea1ng th\u00e1i l\u00e0m vi\u1ec7c sang m\u1ed9t nh\u00e1nh kh\u00e1c ho\u1eb7c m\u1ed9t phi\u00ean b\u1ea3n kh\u00e1c<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git status<\/span><\/td><td><span style=\"font-weight: 400;\">Ki\u1ec3m tra c\u00e1c thay \u0111\u1ed5i \u0111\u00e3 x\u1ea3y ra trong khu v\u1ef1c l\u00e0m vi\u1ec7c hi\u1ec7n t\u1ea1i<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git add<\/span><\/td><td><span style=\"font-weight: 400;\">Th\u00eam 1 file thay \u0111\u1ed5i v\u00e0o khu v\u1ef1c Staging \u0111\u1ec3 chu\u1ea9n b\u1ecb th\u1ef1c hi\u1ec7n commit<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git commit<\/span><\/td><td><span style=\"font-weight: 400;\">Th\u1ef1c hi\u1ec7n l\u1ec7nh commit \u0111\u1ec3 l\u01b0u tr\u1eef c\u00e1c thay \u0111\u1ed5i v\u00e0o repository<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git push<\/span><\/td><td><span style=\"font-weight: 400;\">\u0110\u1ea9y c\u00e1c thay \u0111\u1ed5i \u0111\u00e3 \u0111\u01b0\u1ee3c commit \u1edf kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9 l\u00ean kho l\u01b0u tr\u1eef t\u1eeb xa<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git fetch<\/span><\/td><td><span style=\"font-weight: 400;\">L\u1ea5y c\u00e1c commit thay \u0111\u1ed5i t\u1eeb kho l\u01b0u tr\u1eef t\u1eeb xa nh\u01b0ng kh\u00f4ng ti\u1ebfn h\u00e0nh h\u1ee3p nh\u1ea5t v\u1edbi nh\u00e1nh \u0111ang l\u00e0m vi\u1ec7c<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git merge<\/span><\/td><td><span style=\"font-weight: 400;\">K\u1ebft h\u1ee3p c\u00e1c thay \u0111\u1ed5i t\u1eeb nh\u00e1nh n\u00e0y v\u00e0o m\u1ed9t nh\u00e1nh kh\u00e1c b\u1eb1ng c\u00e1ch h\u1ee3p nh\u1ea5t l\u1ecbch s\u1eed commit<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git pull<\/span><\/td><td><span style=\"font-weight: 400;\">S\u1ef1 k\u1ebft h\u1ee3p gi\u1eefa fetch v\u00e0 merge \u0111\u1ed1i v\u1edbi nh\u00e1nh \u0111ang l\u00e0m vi\u1ec7c<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git revert<\/span><\/td><td><span style=\"font-weight: 400;\">T\u1ea1o ra m\u1ed9t commit v\u1edbi n\u1ed9i dung tr\u00e1i ng\u01b0\u1ee3c v\u1edbi commit tr\u01b0\u1edbc \u0111\u00f3, m\u1ee5c \u0111\u00edch \u0111\u1ec3 ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i \u0111\u00e3 \u0111\u01b0\u1ee3c commit<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">git reset<\/span><\/td><td><span style=\"font-weight: 400;\">Ph\u00e1 v\u1ee1 commit \u0111\u00e3 l\u01b0u, \u0111\u01b0a c\u00e1c file \u0111\u00e3 thay \u0111\u1ed5i t\u1eeb repository v\u1ec1 khu v\u1ef1c l\u00e0m vi\u1ec7c<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc th\u00eam: <a href=\"https:\/\/itviec.com\/blog\/cac-lenh-git-co-ban\/\" target=\"_blank\" rel=\"noopener\"><strong>T\u1ed5ng h\u1ee3p 20+ c\u00e1c l\u1ec7nh Git c\u01a1 b\u1ea3n c\u1ea7n bi\u1ebft<\/strong><\/a><\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-co-nh\u1eefng-ph\u1ea7n-m\u1ec1m-qu\u1ea3n-ly-ma-ngu\u1ed3n-va-t\u01b0\u01a1ng-tac-v\u1edbi-h\u1ec7-th\u1ed1ng-qu\u1ea3n-ly-phien-b\u1ea3n-git-nao\"><b>C\u00f3 nh\u1eefng ph\u1ea7n m\u1ec1m qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n v\u00e0 t\u01b0\u01a1ng t\u00e1c v\u1edbi h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n Git n\u00e0o?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Hi\u1ec7n nay, c\u00f3 r\u1ea5t nhi\u1ec1u ph\u1ea7n m\u1ec1m h\u1ed7 tr\u1ee3 thao t\u00e1c v\u00e0 l\u00e0m vi\u1ec7c v\u1edbi Git, n\u1ed5i b\u1eadt trong s\u1ed1 \u0111\u00f3 ph\u1ea3i k\u1ec3 \u0111\u1ebfn:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">SourceTree (<\/span><a href=\"https:\/\/www.sourcetreeapp.com\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">sourcetreeapp.com<\/span><\/a><span style=\"font-weight: 400;\">):<\/span>\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">M\u1ed9t \u1ee9ng d\u1ee5ng GUI mi\u1ec5n ph\u00ed gi\u00fap t\u01b0\u01a1ng t\u00e1c v\u1edbi Git v\u00e0 Mercurial.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Hi\u1ec3n th\u1ecb giao di\u1ec7n tr\u1ef1c quan l\u1ecbch s\u1eed commit v\u00e0 nh\u00e1nh trong repository, h\u1ed7 tr\u1ee3 th\u1ef1c hi\u1ec7n c\u00e1c thao t\u00e1c commit, merge, pull, push,.. m\u1ed9t c\u00e1ch d\u1ec5 d\u00e0ng.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 k\u1ebft n\u1ed1i tr\u1ef1c ti\u1ebfp v\u1edbi Github, GitLab, BitBucket,&#8230;<\/span><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">GitKraken (<\/span><a href=\"https:\/\/www.gitkraken.com\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">gitkraken.com<\/span><\/a><span style=\"font-weight: 400;\">):<\/span>\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Cung c\u1ea5p giao di\u1ec7n thao t\u00e1c v\u1edbi git.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">T\u00edch h\u1ee3p v\u1edbi c\u00e1c d\u1ecbch v\u1ee5 nh\u01b0 Github, GitLab, BitBucket<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">H\u1ed7 tr\u1ee3 vi\u1ec7c th\u1ef1c hi\u1ec7n Merge, Rebase v\u00e0 x\u1eed l\u00fd conflict.<\/span><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">VS Code (Visual Studio Code):<\/span>\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Tr\u00ecnh so\u1ea1n th\u1ea3o code mi\u1ec5n ph\u00ed c\u00f3 t\u00edch h\u1ee3p Git v\u1edbi c\u00e1c thao t\u00e1c nh\u01b0 pull, push, commit<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00f3 giao di\u1ec7n tr\u1ef1c quan \u0111\u1ec3 \u0111\u1ed1i chi\u1ebfu s\u1ef1 thay \u0111\u1ed5i gi\u1eefa c\u00e1c phi\u00ean b\u1ea3n ngay tr\u00ean tr\u00ecnh so\u1ea1n th\u1ea3o<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 k\u1ebft h\u1ee3p v\u1edbi c\u00e1c Extension nh\u01b0 GitLens, GitHistory \u0111\u1ec3 n\u00e2ng cao c\u00e1c t\u00ednh n\u0103ng.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-k\u1ebft-git-la-gi\"><span class=\"ez-toc-section\" id=\"Tong_ket_Git_la_gi\"><\/span><b>T\u1ed5ng k\u1ebft Git l\u00e0 g\u00ec<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong th\u1eddi \u0111\u1ea1i c\u00f4ng ngh\u1ec7 th\u00f4ng tin ng\u00e0y nay, Git \u0111\u00e3 tr\u1edf th\u00e0nh m\u1ed9t tr\u1ee3 th\u1ee7 v\u00f4 c\u00f9ng \u0111\u1eafc l\u1ef1c trong c\u00e1c d\u1ef1 \u00e1n ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m, \u0111\u00f3ng vai tr\u00f2 gi\u00fap c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n hi\u1ec7u qu\u1ea3 v\u00e0 c\u1ed9ng t\u00e1c d\u1ec5 d\u00e0ng h\u01a1n.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">ITviec hy v\u1ecdng b\u00e0i vi\u1ebft tr\u00ean \u0111\u00e3 gi\u00fap b\u1ea1n c\u00f3 m\u1ed9t c\u00e1i nh\u00ecn t\u1ed5ng quan v\u1ec1 Git v\u00e0 c\u00e1c kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n nh\u01b0 commit, branch, repository. \u0110\u00e2y s\u1ebd l\u00e0 ti\u1ec1n \u0111\u1ec3 \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 b\u1eaft \u0111\u1ea7u kh\u00e1m ph\u00e1 s\u00e2u h\u01a1n v\u1ec1 c\u00e1c t\u00ednh n\u0103ng m\u1ea1nh m\u1ebd c\u1ee7a h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n n\u00e0y v\u00e0 \u00e1p d\u1ee5ng Git v\u00e0o c\u00e1c d\u1ef1 \u00e1n c\u1ee7a b\u1ea3n th\u00e2n.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trong l\u0129nh v\u1ef1c ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m ng\u00e0y nay, l\u00e0m vi\u1ec7c nh\u00f3m (teamwork) gi\u1eefa c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean \u0111\u00f3ng m\u1ed9t vai tr\u00f2 v\u00f4 c\u00f9ng quan tr\u1ecdng. Tuy nhi\u00ean, vi\u1ec7c nhi\u1ec1u ng\u01b0\u1eddi c\u00f9ng tham gia v\u00e0o m\u1ed9t m\u00e3 ngu\u1ed3n s\u1ebd d\u1eabn \u0111\u1ebfn nh\u1eefng kh\u00f3 kh\u0103n trong vi\u1ec7c qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n v\u00e0 h\u1ee3p nh\u1ea5t m\u00e3 ngu\u1ed3n. [&hellip;]<\/p>\n","protected":false},"author":235,"featured_media":81610,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-81375","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t - ITviec Blog<\/title>\n<meta name=\"description\" content=\"Git l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n m\u1ea1nh m\u1ebd m\u00e0 Developer n\u00e0o c\u0169ng c\u1ea7n ph\u1ea3i bi\u1ebft. T\u00ecm hi\u1ec3u git l\u00e0 g\u00ec, bao g\u1ed3m c\u00e1c thu\u1eadt ng\u1eef v\u00e0 c\u00e1ch s\u1eed d\u1ee5ng.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t\" \/>\n<meta property=\"og:description\" content=\"Trong l\u0129nh v\u1ef1c ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m ng\u00e0y nay, l\u00e0m vi\u1ec7c nh\u00f3m (teamwork) gi\u1eefa c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean \u0111\u00f3ng m\u1ed9t vai tr\u00f2 v\u00f4 c\u00f9ng quan tr\u1ecdng. Tuy nhi\u00ean, vi\u1ec7c nhi\u1ec1u\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-25T02:17:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-10T03:37:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-la-gi-vippro.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"790\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ph\u1ea1m H\u1eefu Ng\u1ecdc\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ph\u1ea1m H\u1eefu Ng\u1ecdc\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"22 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t - ITviec Blog","description":"Git l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n m\u1ea1nh m\u1ebd m\u00e0 Developer n\u00e0o c\u0169ng c\u1ea7n ph\u1ea3i bi\u1ebft. T\u00ecm hi\u1ec3u git l\u00e0 g\u00ec, bao g\u1ed3m c\u00e1c thu\u1eadt ng\u1eef v\u00e0 c\u00e1ch s\u1eed d\u1ee5ng.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t","og_description":"Trong l\u0129nh v\u1ef1c ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m ng\u00e0y nay, l\u00e0m vi\u1ec7c nh\u00f3m (teamwork) gi\u1eefa c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean \u0111\u00f3ng m\u1ed9t vai tr\u00f2 v\u00f4 c\u00f9ng quan tr\u1ecdng. Tuy nhi\u00ean, vi\u1ec7c nhi\u1ec1u","og_url":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2024-11-25T02:17:51+00:00","article_modified_time":"2025-07-10T03:37:08+00:00","og_image":[{"width":1500,"height":790,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-la-gi-vippro.jpg","type":"image\/jpeg"}],"author":"Ph\u1ea1m H\u1eefu Ng\u1ecdc","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Ph\u1ea1m H\u1eefu Ng\u1ecdc","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"22 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/"},"author":{"name":"Ph\u1ea1m H\u1eefu Ng\u1ecdc","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/407769a7625b7f955cef615f7a99abad"},"headline":"Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t","datePublished":"2024-11-25T02:17:51+00:00","dateModified":"2025-07-10T03:37:08+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/"},"wordCount":5872,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-la-gi-vippro.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/","url":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/","name":"Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-la-gi-vippro.jpg","datePublished":"2024-11-25T02:17:51+00:00","dateModified":"2025-07-10T03:37:08+00:00","description":"Git l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n m\u1ea1nh m\u1ebd m\u00e0 Developer n\u00e0o c\u0169ng c\u1ea7n ph\u1ea3i bi\u1ebft. T\u00ecm hi\u1ec3u git l\u00e0 g\u00ec, bao g\u1ed3m c\u00e1c thu\u1eadt ng\u1eef v\u00e0 c\u00e1ch s\u1eed d\u1ee5ng.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-la-gi-vippro.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-la-gi-vippro.jpg","width":1500,"height":790,"caption":"git l\u00e0 g\u00ec - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"Git l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, Thu\u1eadt ng\u1eef c\u01a1 b\u1ea3n v\u00e0 C\u00e1ch c\u00e0i \u0111\u1eb7t"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/407769a7625b7f955cef615f7a99abad","name":"Ph\u1ea1m H\u1eefu Ng\u1ecdc","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Pham-Huu-Ngoc-technical-content-reviewer-e1712135841473-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Pham-Huu-Ngoc-technical-content-reviewer-e1712135841473-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Pham-Huu-Ngoc-technical-content-reviewer-e1712135841473-100x100.jpg","caption":"Ph\u1ea1m H\u1eefu Ng\u1ecdc"},"url":"https:\/\/itviec.com\/blog\/author\/pham-huu-ngoc-2\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/81375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/235"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=81375"}],"version-history":[{"count":1,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/81375\/revisions"}],"predecessor-version":[{"id":89221,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/81375\/revisions\/89221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/81610"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=81375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=81375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=81375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}