{"id":800,"date":"2020-12-02T14:30:16","date_gmt":"2020-12-02T07:30:16","guid":{"rendered":"https:\/\/www.marketenterprise.vn\/blog\/?p=800"},"modified":"2021-12-27T18:25:37","modified_gmt":"2021-12-27T11:25:37","slug":"git-la-gi","status":"publish","type":"post","link":"https:\/\/www.marketenterprise.vn\/blog\/git-la-gi.html","title":{"rendered":"Git l\u00e0 g\u00ec?"},"content":{"rendered":"<p><strong>\u0110\u1eb7t v\u1ea5n \u0111\u1ec1 v\u1ec1 Git<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Ng\u00e0y x\u01b0a c\u00f3 hai anh ch\u00e0ng l\u1eadp tr\u00ecnh vi\u00ean may m\u1eafn A v\u00e0 B \u0111ang c\u00f9ng nhau h\u1ee3p t\u00e1c x\u00e2y d\u1ef1ng m\u1ed9t d\u1ef1 \u00e1n. Hai anh l\u00e0m vi\u1ec7c v\u1edbi nhau b\u1eb1ng c\u00e1ch m\u1ed7i ng\u01b0\u1eddi t\u1ef1 vi\u1ebft code cho ch\u1ee9c n\u0103ng c\u1ee7a d\u1ef1 \u00e1n v\u00e0 g\u1eedi cho nhau qua email, fb, zalo&#8230; M\u1ed7i ng\u01b0\u1eddi sau khi nh\u1eadn \u0111\u01b0\u1ee3c code c\u1ee7a nhau s\u1ebd ti\u1ebfn h\u00e0nh r\u00e1p l\u1ea1i v\u00e0 ti\u1ebfp t\u1ee5c ph\u00e1t tri\u1ec3n. Tuy nhi\u00ean v\u00e0o m\u1ed9t ng\u00e0y n\u1ecd, code c\u1ee7a A vi\u1ebft b\u1ecb sai d\u1eabn t\u1edbi s\u1ea3n ph\u1ea9m b\u1ecb l\u1ed7i m\u00e0 tr\u01b0\u1edbc \u0111\u00f3 c\u1ea3 hai \u0111\u1ec1u kh\u00f4ng h\u1ec1 l\u01b0u l\u1ea1i do ph\u1ea7n m\u1ec1m qu\u00e1 l\u1edbn. V\u00e0 th\u1ebf l\u00e0 hai anh ph\u1ea3i c\u00f9ng nhau x\u00e2y d\u1ef1ng l\u1ea1i t\u00ednh n\u0103ng b\u1ecb l\u1ed7i v\u00e0 ti\u1ebfp t\u1ee5c g\u1eedi code cho nhau nh\u01b0 m\u1ecdi khi.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">B\u1ea3n th\u00e2n m\u00ecnh th\u1ea5y c\u00f3 2 v\u1ea5n \u0111\u1ec1 \u1edf \u0111\u00e2y:<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Vi\u1ec7c m\u1ed7i ng\u01b0\u1eddi t\u1ef1 code r\u1ed3i g\u1eedi cho nhau, sau \u0111\u00f3 gh\u00e9p l\u1ea1i th\u00ec r\u1ea5t b\u1ea5t ti\u1ec7n. Th\u1eed t\u01b0\u1edfng t\u01b0\u1ee3ng xem d\u1ef1 \u00e1n c\u00f3 nhi\u1ec1u ng\u01b0\u1eddi, vi\u1ec7c gh\u00e9p code l\u1ea1i r\u1ea5t d\u1ec5 x\u1ea3y ra sai s\u00f3t v\u00e0 m\u1ea5t th\u1eddi gian. L\u00fac n\u00e0y ch\u1ec9 \u01b0\u1edbc l\u00e0 gi\u00e1 nh\u01b0 c\u00f3 th\u1ec3 xem \u0111\u01b0\u1ee3c nh\u1eefng thay \u0111\u1ed5i trong d\u1ef1 \u00e1n t\u1eeb xa v\u00e0 ti\u1ebfn h\u00e0nh gh\u00e9p code tr\u1ef1c ti\u1ebfp v\u00e0o d\u1ef1 \u00e1n th\u00ec ti\u1ec7n l\u1ee3i bi\u1ebft m\u1ea5y.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">C\u00f3 c\u00e1ch n\u00e0o kh\u00f4ng lo m\u1ea5t code hay l\u00e0 revert l\u1ea1i nh\u1eefng ph\u1ea7n c\u0169 hay kh\u00f4ng? Thay v\u00ec ph\u1ea3i vi\u1ebft l\u1ea1i t\u1eeb \u0111\u1ea7u khi ph\u1ea7n m\u1ec1m b\u1ecb l\u1ed7i.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">V\u1edbi 2 v\u1ea5n \u0111\u1ec1 tr\u00ean, Git c\u00f3 th\u1ec3 gi\u00fap 2 anh ch\u00e0ng may m\u1eafn kia gi\u1ea3i quy\u1ebft v\u1ea5n \u0111\u1ec1 d\u1ec5 d\u00e0ng h\u01a1n r\u1ea5t nhi\u1ec1u v\u00e0 Git c\u00f2n r\u1ea5t nhi\u1ec1u t\u00ednh n\u0103ng h\u1eefu d\u1ee5ng kh\u00e1c. <\/span><span style=\"font-weight: 400;\">M\u1eddi c\u00e1c b\u1ea1n xem ti\u1ebfp ph\u1ea7n gi\u1edbi thi\u1ec7u chi ti\u1ebft d\u01b0\u1edbi \u0111\u00e2y.<\/span><\/li>\n<\/ul>\n<p><strong>V\u1eady \u0111\u1ea7u ti\u00ean Git l\u00e0 g\u00ec?<\/strong><\/p>\n<h2>Source control l\u00e0 g\u00ec?<\/h2>\n<p><strong>Tr\u01b0\u1edbc khi bi\u1ebft git l\u00e0 g\u00ec th\u00ec m\u00ecnh c\u0169ng n\u00ean t\u00ecm hi\u1ec3u source control l\u00e0 g\u00ec tr\u01b0\u1edbc\u00a0<\/strong><\/p>\n<p><b>Source control<\/b><span style=\"font-weight: 400;\"> l\u00e0 h\u1ec7 th\u1ed1ng l\u01b0u tr\u1eef m\u1ecdi thay \u0111\u1ed5i c\u1ee7a source code v\u00ed d\u1ee5 nh\u01b0 b\u1ea1n th\u00eam, x\u00f3a, s\u1eeda m\u1ed9t v\u00e0i d\u00f2ng trong source code n\u00f3 c\u0169ng l\u01b0u l\u1ea1i h\u1ebft, h\u1ed7 tr\u1ee3 nhi\u1ec1u ng\u01b0\u1eddi l\u00e0m vi\u1ec7c c\u00f9ng l\u00fac, xem ai thay \u0111\u1ed5i code chung, xem d\u00f2ng code n\u00e0y do ai vi\u1ebft, revert c\u00e1c thay \u0111\u1ed5i, \u0111\u01b0a code v\u1ec1 version c\u0169 h\u01a1n m\u00e0 kh\u00f4ng lo m\u1ea5t code. H\u1ea7u nh\u01b0 c\u00f4ng ty to hay nh\u1ecf \u0111\u1ec1u d\u00f9ng source control \u0111\u1ec3 qu\u1ea3n l\u00fd source code.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><\/span><\/p>\n<h2>Git l\u00e0\u00a0 g\u00ec?<\/h2>\n<p><span style=\"font-weight: 400;\">Git c\u0169ng l\u00e0 1 d\u1ea1ng <\/span><b>source control<\/b><span style=\"font-weight: 400;\">, l\u00e0 t\u00ean g\u1ecdi c\u1ee7a m\u1ed9t H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ph\u00e2n t\u00e1n (Distributed version control system &#8211; DVCS) , tr\u01b0\u1edbc kia ng\u01b0\u1eddi ta hay d\u00f9ng Subversion ( SVN) do google h\u1ed7 tr\u1ee3 kh\u00e1 l\u00e0 ti\u1ec7n, nh\u01b0ng trong v\u00f2ng nhi\u1ec1u n\u0103m tr\u1edf l\u1ea1i \u0111\u00e2y git \u0111ang tr\u1edf th\u00e0nh 1 xu th\u1ebf m\u1edbi, thay th\u1ebf d\u1ea7n cho SVN, v\u00e0 \u0111ang c\u00f3 m\u1ed9t c\u1ed9ng \u0111\u1ed3ng ng\u01b0\u1eddi d\u00f9ng r\u1ea5t l\u1edbn.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><\/span><\/p>\n<h2>D\u00f9ng git trong nh\u1eefng tr\u01b0\u1eddng h\u1ee3p n\u00e0o?<\/h2>\n<p><span style=\"font-weight: 400;\">V\u1ec1 vi\u1ec7c t\u1ea1i sao d\u00f9ng Git th\u00ec qua v\u00ed d\u1ee5 \u1edf \u0111\u1ea7u b\u00e0i \u0111\u00e3 tr\u1ea3 l\u1eddi cho c\u00e2u h\u1ecfi n\u00e0y r\u1ed3i. Git \u0111\u00e1p \u1ee9ng gi\u1ea3i quy\u1ebft c\u00e1c v\u1ea5n \u0111\u1ec1 nh\u1ee9c nh\u1ed1i<\/span><span style=\"font-weight: 400;\">\u00a0 v\u1ec1 <\/span><span style=\"font-weight: 400;\">qu\u1ea3n l\u00fd source code v\u00e0 c\u00f3 h\u00e0ng lo\u1ea1t t\u00ednh n\u0103ng h\u1eefu \u00edch gi\u00fap cho vi\u1ec7c ph\u00e1t tri\u1ec3n source code nhanh v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n.\u00a0<\/span><\/p>\n<p><strong>C\u1ee5 th\u1ec3:<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Git gi\u00fap ch\u00fang ta c\u00f3 th\u1ec3 quay l\u1ea1i v\u00e0 xem code c\u1ee7a d\u1ef1 \u00e1n \u1edf b\u1ea5t k\u1ef3 th\u1eddi \u0111i\u1ec3m n\u00e0o tr\u01b0\u1edbc \u0111\u00f3, mi\u1ec5n l\u00e0 tr\u01b0\u1edbc \u0111\u00f3 b\u1ea1n c\u00f3 l\u01b0u l\u1ea1i tr\u1ea1ng th\u00e1i \u0111\u00f3 nh\u00e9.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">L\u01b0u l\u1ea1i c\u00e1c thay \u0111\u1ed5i nh\u01b0 th\u00eam, x\u00f3a, s\u1eeda c\u00e1c file c\u1ee5 th\u1ec3 t\u1eebng d\u00f2ng v\u00e0 t\u1eebng k\u00fd t\u1ef1.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Truy l\u00f9ng d\u1ea5u v\u1ebft c\u1ee7a ai trong team vi\u1ebft ra \u1edf th\u1eddi gian n\u00e0o, r\u1ea5t h\u1eefu \u00edch cho vi\u1ec7c review code.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Mang l\u1ea1i hi\u1ec7u qu\u1ea3 cao khi l\u00e0m vi\u1ec7c nh\u00f3m b\u1eb1ng vi\u1ec7c ph\u00e2n chia module v\u00e0 ph\u00e1t tri\u1ec3n c\u00e1c t\u00ednh n\u0103ng ri\u00eang bi\u1ec7t tr\u00ean c\u00e1ch branch kh\u00e1c nhau.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">D\u1ec5 d\u00e0ng trong vi\u1ec7c deploy s\u1ea3n ph\u1ea9m.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Ngo\u00e0i ra, c\u00f2n r\u1ea5t nhi\u1ec1u c\u00e1c t\u00ednh n\u0103ng \u01b0u vi\u1ec7t n\u1eefa ch\u1edd c\u00e1c b\u1ea1n kh\u00e1m ph\u00e1 th\u00eam nh\u00e9.<\/span><\/li>\n<\/ul>\n<p><b>\u00a0V\u1eady khi n\u00e0o th\u00ec c\u1ea7n d\u00f9ng Git vi\u1ec7c \u0111\u00f3 tu\u1ef3 v\u00e0o b\u1ea1n nh\u00e9.<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Theo \u00fd ki\u1ebfn c\u1ee7a m\u00ecnh n\u1ebfu \u0111\u00e3 l\u00e0 m\u1ed9t l\u1eadp tr\u00ecnh vi\u00ean th\u00ec quanh n\u0103m \u0103n ng\u1ee7 v\u1edbi code n\u00ean vi\u1ec7c s\u1eed d\u1ee5ng git everywhere \u0111\u00f3 l\u00e0 m\u1ed9t \u0111i\u1ec1u t\u1ea5t y\u1ebfu v\u00e0 c\u1ea7n thi\u1ebft.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Git mang \u0111\u1ebfn cho ta r\u1ea5t nhi\u1ec1u \u0111i\u1ec1u tuy\u1ec7t v\u1eddi v\u00e0 ti\u1ec7n d\u1ee5ng cho vi\u1ec7c ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng, ph\u1ea7n m\u1ec1m \u0111\u1eb7c bi\u1ec7t l\u00e0 theo h\u01b0\u1edbng l\u00e0m vi\u1ec7c nh\u00f3m. V\u1eady c\u00e2u h\u1ecfi \u0111\u01b0\u1ee3c \u0111\u1eb7t ra \u1edf \u0111\u00e2y l\u00e0 Git c\u00f3 c\u1ea7n thi\u1ebft khi l\u00e0m vi\u1ec7c m\u1ed9t m\u00ecnh kh\u00f4ng? Theo m\u00ecnh th\u00ec Git sinh ra l\u00e0 \u0111\u1ec3 <\/span><b>qu\u1ea3n l\u00fd source code <\/b><span style=\"font-weight: 400;\">n\u00f3i chung ch\u1ee9 kh\u00f4ng ph\u1ea3i qu\u1ea3n l\u00fd code c\u1ee7a bao nhi\u00eau ng\u01b0\u1eddi vi\u1ebft ra.B\u1ea1n h\u00e3y t\u01b0\u1edfng t\u01b0\u1ee3ng, n\u1ebfu m\u1ed9t ng\u00e0y n\u00e0o \u0111\u00f3 b\u1ea1n l\u00e0m vi\u1ec7c m\u1ed9t m\u00ecnh, t\u00e2m tr\u1ea1ng \u0111ang b\u1ea5n lo\u1ea1n , l\u1ee1 tay x\u00f3a m\u1ed9t d\u00f2ng code n\u00e0o \u0111\u00f3 d\u1eabn \u0111\u1ebfn error tr\u00e0n ng\u1eadp m\u00e0n h\u00ecnh th\u00ec v\u1ea5t v\u1ea3 l\u1eafm \u0111\u1ea5y. <\/span><span style=\"font-weight: 400;\">L\u00fac n\u00e0y, Git s\u1ebd l\u00e0 c\u1ee9u c\u00e1nh c\u1ee7a b\u1ea1n. V\u00ec v\u1eady d\u00f9 l\u00e0m vi\u1ec7c nh\u00f3m hay m\u1ed9t m\u00ecnh th\u00ec Git c\u0169ng th\u1ef1c s\u1ef1 s\u1ebd gi\u00fap \u00edch r\u1ea5t nhi\u1ec1u cho n\u0103ng su\u1ea5t c\u0169ng nh\u01b0 hi\u1ec7u qu\u1ea3 c\u00f4ng vi\u1ec7c c\u1ee7a b\u1ea1n<\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><b>Git is the best gift for your life.<\/b><br \/>\n<span style=\"font-weight: 400;\"><\/span><\/p>\n<h2>Git c\u00f3 3 kh\u00e1i ni\u1ec7m quan tr\u1ecdng l\u00e0<\/h2>\n<ul>\n<li style=\"font-weight: 400;\">\n<h3>Repository<\/h3>\n<p><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 coi n\u00f3 l\u00e0 1 d\u1ef1 \u00e1n, ch\u1ee9a to\u00e0n b\u1ed9 source code, l\u00e0 n\u01a1i s\u1ebd ghi l\u1ea1i tr\u1ea1ng th\u00e1i c\u1ee7a th\u01b0 m\u1ee5c v\u00e0 file t\u1eeb khi b\u1ea1n kh\u1edfi t\u1ea1o \u0111\u1ebfn hi\u1ec7n t\u1ea1i. N\u1ebfu repository \u0111\u01b0\u1ee3c l\u01b0u tr\u00ean m\u00e1y t\u00ednh c\u1ee7a b\u1ea1n, n\u00f3 \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 <\/span><b>local repository, <\/b><span style=\"font-weight: 400;\">c\u00f2n n\u1ebfu n\u00f3 \u0111\u01b0\u1ee3c l\u01b0u \u1edf tr\u00ean c\u00e1c server chuy\u00ean cung c\u1ea5p d\u1ecbch v\u1ee5 v\u1ec1 git n\u00f3 \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0<\/span><b> remote repository. <\/b><span style=\"font-weight: 400;\">Hi\u1ec7n nay c\u00f3 m\u1ed9t s\u1ed1 Git server ph\u1ed5 bi\u1ebfn nh\u01b0 l\u00e0 Github, GitLab, Bitbucket,\u2026<\/span><\/li>\n<\/ul>\n<div class=\"text-center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-801 \" src=\"https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02133237\/129094677_195184582156270_2096294795549968689_n.png\" alt=\"\" width=\"447\" height=\"182\" srcset=\"https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02133237\/129094677_195184582156270_2096294795549968689_n.png 441w, https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02133237\/129094677_195184582156270_2096294795549968689_n-300x122.png 300w\" sizes=\"auto, (max-width: 447px) 100vw, 447px\" \/><\/div>\n<ul>\n<li style=\"font-weight: 400;\">\n<h3>Commit<\/h3>\n<p><span style=\"font-weight: 400;\">M\u1ed9t repository th\u00ec ch\u1ee9a r\u1ea5t nhi\u1ec1u commit, commit \u0111\u00f3 l\u00e0 nh\u1eefng l\u1ea7n b\u1ea1n s\u1eeda code, th\u00eam, x\u00f3a file, thay \u0111\u1ed5i code \u0111\u1ec1u \u0111\u01b0\u1ee3c t\u00ednh l\u00e0\u00a0 commit, nh\u1eefng commit \u0111\u00f3 \u0111\u01b0\u1ee3c l\u01b0u v\u00e0o repository.<\/span><\/li>\n<\/ul>\n<div class=\"text-center\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-802 size-full aligncenter\" src=\"https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02133239\/128542486_1772549242909412_67195293068369564_n.png\" alt=\"\" width=\"620\" height=\"206\" srcset=\"https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02133239\/128542486_1772549242909412_67195293068369564_n.png 620w, https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02133239\/128542486_1772549242909412_67195293068369564_n-300x100.png 300w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/div>\n<ul>\n<li style=\"font-weight: 400;\">\n<h3>Branch<\/h3>\n<p><span style=\"font-weight: 400;\">L\u00e0 c\u00e1i d\u00f9ng \u0111\u1ec3 ph\u00e2n nh\u00e1nh v\u00e0 ghi l\u1ea1i lu\u1ed3ng c\u1ee7a l\u1ecbch s\u1eed ph\u00e1t tri\u1ec3n code c\u1ee7a d\u1ef1 \u00e1n. Branch \u0111\u00e3 ph\u00e2n nh\u00e1nh s\u1ebd kh\u00f4ng \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn c\u00e1c branch kh\u00e1c n\u00ean c\u00f3 th\u1ec3 ti\u1ebfn h\u00e0nh nhi\u1ec1u thay \u0111\u1ed5i \u0111\u1ed3ng th\u1eddi trong c\u00f9ng 1 repository.<\/span><\/li>\n<\/ul>\n<div class=\"text-center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-806 size-full\" src=\"https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02141309\/129383991_858479214889116_613321699328563192_n.jpg\" alt=\"\" width=\"591\" height=\"310\" srcset=\"https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02141309\/129383991_858479214889116_613321699328563192_n.jpg 591w, https:\/\/mevn-public.s3-ap-southeast-1.amazonaws.com\/marketenterprise.vn\/wp-images\/2020\/12\/02141309\/129383991_858479214889116_613321699328563192_n-300x157.jpg 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/div>\n<h2>M\u1ed9t s\u1ed1 l\u1ec7nh c\u01a1 b\u1ea3n c\u1ee7a Git<\/h2>\n<h3>Kh\u1edfi t\u1ea1o Git trong project c\u1ee7a b\u1ea1n<\/h3>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><span style=\"font-weight: 400;\">\u0110\u1ec3 Git c\u00f3 th\u1ec3 b\u1eaft \u0111\u1ea7u theo d\u00f5i qu\u00e1 tr\u00ecnh code c\u1ee7a b\u1ea1n nh\u01b0: Th\u00eam m\u1edbi, s\u1eeda \u0111\u1ed5i, x\u00f3a file th\u00ec b\u1ea1n ph\u1ea3i kh\u1edfi t\u1ea1o git trong project:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p style=\"text-align: left;\"><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0git init<\/b><b><br \/>\n<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u0110\u1ec3 sao ch\u00e9p remote repository s\u1ebd th\u1ef1c hi\u1ec7n thao t\u00e1c g\u1ecdi l\u00e0 \u201cclone\u201d.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 g<\/span><b>it clone \/path\/to\/repository\u00a0<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u0110\u1ec3 xem h\u1ebft nh\u1eefng file \u0111\u00e3 thay \u0111\u1ed5i trong qu\u00e1 tr\u00ecnh code, ta d\u00f9ng l\u1ec7nh:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0git status\u00a0<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u0110\u1ec3 add h\u1ebft c\u00e1c file \u0111\u00e3 thay \u0111\u1ed5i v\u00e0o stage, ta d\u00f9ng c\u00e2u l\u1ec7nh sau:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0git add<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">L\u01b0u h\u1ebft c\u00e1c thay \u0111\u1ed5i c\u1ee7a b\u1ea1n \u0111\u00e3 add v\u00e0o stage \u1edf b\u01b0\u1edbc tr\u00ean l\u00ean repository \u1edf local ta d\u00f9ng l\u1ec7nh sau:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0git commit -m \u201ccommit message\u201d<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Khi \u0111\u00e3 l\u01b0u h\u1ebft c\u00e1c tr\u1ea1ng th\u00e1i c\u1ee7a source code, ta \u0111\u1ea9y c\u00e1c thay \u0111\u1ed5i t\u1eeb repository \u1edf local l\u00ean remote repository.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0git push &lt;remote_repository&gt; &lt;branch&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/span><\/p>\n<h3>\u00a0L\u00e0m vi\u1ec7c v\u1edbi branch trong Git<\/h3>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><span style=\"font-weight: 400;\">\u1ede m\u1ee5c 4 m\u00ecnh c\u00f3 n\u00f3i branch l\u00e0 m\u1ed9t trong nh\u1eefng ch\u1ee9c n\u0103ng quan tr\u1ecdng v\u00e0 c\u1ef1c k\u1ef3 l\u1ee3i h\u1ea1i c\u1ee7a git trong vi\u1ec7c t\u00e1ch c\u00e1c module v\u00e0 ch\u1ee9c n\u0103ng c\u1ee7a Repository, h\u1ea7u nh\u01b0 trong m\u1ecdi d\u1ef1 \u00e1n c\u1ee7a c\u00e1c c\u00f4ng ty l\u1edbn nh\u1ecf \u0111\u1ec1u d\u00f9ng \u0111\u1ebfn n\u00f3.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">H\u01a1n n\u1eefa, vi\u1ec7c t\u00e1ch nhi\u1ec1u branch cho nhi\u1ec1u ch\u1ee9c n\u0103ng kh\u00e1c nhau \u0111\u1ec3 th\u1ef1c hi\u1ec7n r\u1ed3i sau \u0111\u00f3 t\u1ed5ng h\u1ee3p v\u00e0o 1 branch chung b\u1eb1ng vi\u1ec7c <\/span><b>merge<\/b><span style=\"font-weight: 400;\"> ch\u00fang l\u1ea1i v\u1edbi nhau.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u0110\u1ec3 t\u1ea1o m\u1ed9t branch m\u1edbi trong Git, ta d\u00f9ng l\u1ec7nh<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0git branch &lt;new_branch&gt;<\/b><b><br \/>\n<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Switch qua branch kh\u00e1c, ta d\u00f9ng l\u1ec7nh:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 git checkout &lt;name_branch&gt;<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">List danh s\u00e1ch c\u00e1c branch, ta d\u00f9ng l\u1ec7nh:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 git branch -a<\/b><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u0110\u1ec3 t\u1ea3i xu\u1ed1ng n\u1ed9i dung t\u1eeb remote repository v\u00e0 c\u1eadp nh\u1eadt \u1edf local repository, ta d\u00f9ng l\u1ec7nh:<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/b> g<b>it pull<\/b><b><br \/>\n<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u1ede tr\u00ean l\u00e0 nh\u1eefng l\u1ec7nh c\u01a1 b\u1ea3n m\u00e0 m\u00ecnh th\u01b0\u1eddng xuy\u00ean d\u00f9ng khi thao t\u00e1c v\u1edbi Git, ngo\u00e0i ra c\u00f2n m\u1ed9t ph\u1ea7n m\u00ecnh ch\u01b0a \u0111\u1ec1 c\u1eadp t\u1edbi n\u1eefa l\u00e0 v\u1ea5n \u0111\u1ec1 v\u1ec1 <\/span><b>Merge Branch<\/b><span style=\"font-weight: 400;\"> v\u00e0 <\/span><b>x\u1eed l\u00fd conflict<\/b><span style=\"font-weight: 400;\">, c\u00e1c b\u1ea1n c\u00f3 th\u1ec3 xem th\u00eam <\/span><a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Git-Branching-Basic-Branching-and-Merging\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">t\u1ea1i \u0111\u00e2y<\/span><\/a><span style=\"font-weight: 400;\">. Do ph\u1ea1m vi c\u1ee7a b\u00e0i vi\u1ebft n\u00ean m\u00ecnh kh\u00f4ng c\u00f3 th\u1eddi gian n\u00f3i v\u1ec1 ph\u1ea7n n\u00e0y, mong c\u00e1c b\u1ea1n th\u00f4ng c\u1ea3m nh\u00e9.<\/span><\/p>\n<h2>K\u1ebft Lu\u1eadn<\/h2>\n<p><span style=\"font-weight: 400;\">Hi\u1ec7n t\u1ea1i Git \u0111ang \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng r\u1ea5t nhi\u1ec1u trong m\u00f4i tr\u01b0\u1eddng l\u1eadp tr\u00ecnh, \u0111\u1ec3 vi\u1ec7c qu\u1ea3n l\u00fd source code tr\u1edf n\u00ean \u0111\u01a1n gi\u1ea3n v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n \u0111\u1eb7c bi\u1ec7t l\u00e0 khi l\u00e0m vi\u1ec7c nh\u00f3m.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">D\u00f9 ch\u01b0a th\u1ef1c s\u1ef1 \u0111\u1ea7y \u0111\u1ee7 nh\u01b0ng hy v\u1ecdng b\u00e0i vi\u1ebft n\u00e0y s\u1ebd ph\u1ea7n n\u00e0o gi\u00fap cho c\u00e1c b\u1ea1n m\u1edbi b\u1eaft \u0111\u1ea7u hi\u1ec3u \u0111\u01b0\u1ee3c kh\u00e1i ni\u1ec7m c\u0169ng nh\u01b0 l\u1ee3i \u00edch c\u1ee7a Git \u0111\u1ec3 thu\u1eadn l\u1ee3i h\u01a1n trong c\u00f4ng vi\u1ec7c.<\/span><\/p>\n<h2>T\u00e0i li\u1ec7u tham kh\u1ea3o<\/h2>\n<p><a href=\"https:\/\/git-scm.com\/doc\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/git-scm.com\/doc<\/span><\/a><\/p>\n<p><a href=\"https:\/\/codelearn.io\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/codelearn.io\/<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>B\u00e0i vi\u1ebft d\u01b0\u1edbi \u0111\u00e2y s\u1ebd gi\u00fap c\u00e1c b\u1ea1n hi\u1ec3u Git l\u00e0 g\u00ec? H\u00e3y c\u00f9ng \u0111\u1ecdc v\u00e0 \u00e1p d\u1ee5ng nh\u00e9!<\/p>\n","protected":false},"author":23,"featured_media":804,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4,46,34],"class_list":["post-800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-blog","tag-git","tag-marketenterprise-vietnam"],"_links":{"self":[{"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/posts\/800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/comments?post=800"}],"version-history":[{"count":0,"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/posts\/800\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/media\/804"}],"wp:attachment":[{"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/media?parent=800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/categories?post=800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.marketenterprise.vn\/blog\/wp-json\/wp\/v2\/tags?post=800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}