{"id":82085,"date":"2024-11-28T15:09:14","date_gmt":"2024-11-28T08:09:14","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=82085"},"modified":"2025-07-10T10:44:36","modified_gmt":"2025-07-10T03:44:36","slug":"git-checkout-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/","title":{"rendered":"Git Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft"},"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\/git-checkout-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-2\" href=\"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#Git_Checkout_la_gi\" >Git Checkout 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-3\" href=\"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#Cac_truong_hop_su_dung_Git_Checkout_kem_vi_du_chi_tiet\" >C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng Git Checkout k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft<\/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\/git-checkout-la-gi\/#Cac_loi_thuong_gap_khi_lam_viec_voi_Git_Checkout\" >C\u00e1c l\u1ed7i th\u01b0\u1eddng g\u1eb7p khi l\u00e0m vi\u1ec7c v\u1edbi Git Checkout<\/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\/git-checkout-la-gi\/#Cac_cau_hoi_thuong_gap_ve_Git_Checkout\" >C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Git Checkout<\/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\/git-checkout-la-gi\/#Tong_ket_Git_Checkout\" >T\u1ed5ng k\u1ebft Git Checkout<\/a><\/li><\/ul><\/nav><\/div>\n\n<p><em><strong>Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang ta s\u1ebd c\u00f9ng t\u00ecm hi\u1ec3u v\u1ec1 Git Checkout, m\u1ed9t l\u1ec7nh quan tr\u1ecdng v\u1edbi nhi\u1ec1u ch\u1ee9c n\u0103ng trong Git nh\u01b0 chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh, chuy\u1ec3n \u0111\u1ed5i tag, ho\u00e0n t\u00e1c,&#8230; c\u00f9ng c\u00e1c l\u1ec7nh Git thay th\u1ebf cho m\u1ed9t v\u00e0i tr\u01b0\u1eddng h\u1ee3p.<\/strong><\/em><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Git checkout l\u00e0 g\u00ec?<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng Git checkout<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00e1c l\u1ed7i th\u01b0\u1eddng g\u1eb7p khi s\u1eed d\u1ee5ng Git checkout<\/span><\/li>\n<\/ul>\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 m\u1ea1nh m\u1ebd, gi\u00fap h\u1ed7 tr\u1ee3 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3. Git l\u1ea7n \u0111\u1ea7u \u0111\u01b0\u1ee3c ra m\u1eaft v\u00e0o n\u0103m 2005 b\u1edfi Linus Torvalds. 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<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<\/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<\/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<\/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<\/span><\/li>\n<\/ul>\n\n\n\n<p>\u0110\u1ecdc th\u00eam c\u00e1c b\u00e0i vi\u1ebft t\u1ed5ng quan v\u1ec1 Git:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/itviec.com\/blog\/tong-quan-git-la-gi\/\" target=\"_blank\" rel=\"noopener\">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<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itviec.com\/blog\/git-vs-github\/\" target=\"_blank\" rel=\"noopener\">Git vs GitHub: C\u00e1c \u0111i\u1ec3m kh\u00e1c nhau v\u00e0 C\u00e1ch k\u1ebft h\u1ee3p<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itviec.com\/blog\/cac-lenh-git-co-ban\/\" target=\"_blank\" rel=\"noopener\">T\u1ed5ng h\u1ee3p 20+ c\u00e1c l\u1ec7nh Git c\u01a1 b\u1ea3n c\u1ea7n bi\u1ebft<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-git-checkout-la-gi\"><span class=\"ez-toc-section\" id=\"Git_Checkout_la_gi\"><\/span><b>Git Checkout l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/itviec.com\/blog\/git-branch-la-gi\/\" target=\"_blank\" rel=\"noopener\"><strong>Git branch<\/strong><\/a> l\u00e0 m\u1ed9t s\u1ef1 thay \u0111\u1ed5i \u0111\u00e1ng k\u1ec3 c\u1ee7a Git so v\u1edbi quy tr\u00ecnh l\u00e0m vi\u1ec7c truy\u1ec1n th\u1ed1ng c\u1ee7a Subversion (SVN). Vi\u1ec7c c\u00f3 nh\u1eefng nh\u00e1nh ri\u00eang gi\u00fap d\u1ec5 d\u00e0ng th\u1eed nghi\u1ec7m nh\u1eefng \u00fd t\u01b0\u1edfng m\u1edbi m\u00e0 kh\u00f4ng s\u1ee3 l\u00e0m h\u1ecfng ch\u1ee9c n\u0103ng hi\u1ec7n c\u00f3 v\u00e0 cho ph\u00e9p l\u00e0m vi\u1ec7c tr\u00ean nhi\u1ec1u t\u00ednh n\u0103ng kh\u00f4ng li\u00ean quan c\u00f9ng m\u1ed9t l\u00fac. Ngo\u00e0i ra, c\u00e1c nh\u00e1nh c\u00f2n h\u1ed7 tr\u1ee3 nhi\u1ec1u quy tr\u00ecnh l\u00e0m vi\u1ec7c c\u1ed9ng t\u00e1c.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u1ec7nh <\/span><b>git checkout<\/b><span style=\"font-weight: 400;\"> cho ph\u00e9p b\u1ea1n di chuy\u1ec3n gi\u1eefa c\u00e1c branch (nh\u00e1nh) trong Git. Khi b\u1ea1n checkout m\u1ed9t nh\u00e1nh, c\u00e1c t\u1eadp tin trong th\u01b0 m\u1ee5c l\u00e0m vi\u1ec7c s\u1ebd \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt \u0111\u1ec3 kh\u1edbp v\u1edbi phi\u00ean b\u1ea3n \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong nh\u00e1nh \u0111\u00f3 v\u00e0 Git s\u1ebd ghi l\u1ea1i t\u1ea5t c\u1ea3 c\u00e1c commit m\u1edbi tr\u00ean nh\u00e1nh \u0111\u00f3. H\u00e3y xem n\u00f3 nh\u01b0 l\u00e0 m\u1ed9t c\u00e1ch \u0111\u1ec3 ch\u1ecdn d\u00f2ng ph\u00e1t tri\u1ec3n m\u00e0 b\u1ea1n \u0111ang l\u00e0m vi\u1ec7c.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Ngo\u00e0i t\u00ednh n\u0103ng ch\u00ednh l\u00e0 chuy\u1ec3n \u0111\u1ed5i tr\u1ea1ng th\u00e1i l\u00e0m vi\u1ec7c gi\u1eefa c\u00e1c nh\u00e1nh, Git Checkout c\u00f2n \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong m\u1ed9t s\u1ed1 tr\u01b0\u1eddng h\u1ee3p kh\u00e1c nh\u01b0 sau.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-tr\u01b0\u1eddng-h\u1ee3p-s\u1eed-d\u1ee5ng-git-checkout-kem-vi-d\u1ee5-chi-ti\u1ebft\"><span class=\"ez-toc-section\" id=\"Cac_truong_hop_su_dung_Git_Checkout_kem_vi_du_chi_tiet\"><\/span><b> C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng Git Checkout k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-chuy\u1ec3n-d\u1ed5i-nhanh-n\u1ed9i-b\u1ed9-va-nhanh-t\u1eeb-xa\"><b>Chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh n\u1ed9i b\u1ed9 v\u00e0 nh\u00e1nh t\u1eeb xa<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng Git Checkout \u0111\u1ec3 chuy\u1ec3n \u0111\u1ed5i tr\u1ea1ng th\u00e1i l\u00e0m vi\u1ec7c t\u1eeb nh\u00e1nh n\u00e0y sang nh\u00e1nh kh\u00e1c, b\u1ea1n s\u1eed d\u1ee5ng c\u00fa ph\u00e1p sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout &lt;t\u00ean nh\u00e1nh&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110i\u1ec1u n\u00e0y s\u1ebd \u0111\u01b0a HEAD (*) \u0111\u1ebfn commit c\u1ee7a c\u00f9ng c\u1ee7a nh\u00e1nh \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ebfn.<\/span><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><i><span style=\"font-weight: 400;\">(*) HEAD l\u00e0 tham chi\u1ebfu \u0111\u1eb7c bi\u1ec7t tr\u1ecf \u0111\u1ebfn commit hi\u1ec7n t\u1ea1i, n\u00f3 th\u1ec3 hi\u1ec7n tr\u1ea1ng th\u00e1i t\u1eadp tin \u0111ang \u0111\u01b0\u1ee3c l\u00e0m vi\u1ec7c.<\/span><\/i><\/p>\n<\/blockquote>\n\n\n\n<p><span style=\"font-weight: 400;\">Tr\u01b0\u1eddng h\u1ee3p mu\u1ed1n chuy\u1ec3n sang m\u1ed9t nh\u00e1nh t\u1eeb kho l\u01b0u tr\u1eef t\u1eeb xa, b\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n theo c\u00e1c b\u01b0\u1edbc sau:<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u1ea5y n\u1ed9i dung c\u1ee7a nh\u00e1nh tr\u00ean kho l\u01b0u tr\u1eef t\u1eeb xa<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git fetch --all<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Sau \u0111\u00f3, s\u1eed d\u1ee5ng git checkout \u0111\u1ebfn nh\u00e1nh t\u1eeb xa nh\u01b0 m\u1ed9t nh\u00e1nh c\u1ee5c b\u1ed9<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout &lt;nh\u00e1nh remote&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, b\u1ea1n \u0111ang l\u00e0m vi\u1ec7c tr\u00ean nh\u00e1nh develop, b\u00e2y gi\u1edd b\u1ea1n mu\u1ed1n chuy\u1ec3n sang nh\u00e1nh main, h\u00e3y th\u1ef1c hi\u1ec7n l\u1ec7nh sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout main<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">K\u1ec3 t\u1eeb phi\u00ean b\u1ea3n 2.23, Git \u0111\u00e3 b\u1ed5 sung th\u00eam l\u1ec7nh switch \u0111\u1ec3 t\u00e1ch bi\u1ec7t ch\u1ee9c n\u0103ng chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh v\u1edbi git checkout:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git switch &lt;t\u00ean nh\u00e1nh&gt;<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-t\u1ea1o-va-chuy\u1ec3n-sang-nhanh-m\u1edbi\"><b>T\u1ea1o v\u00e0 chuy\u1ec3n sang nh\u00e1nh m\u1edbi<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Th\u00f4ng th\u01b0\u1eddng khi c\u1ea7n t\u1ea1o m\u1ed9t nh\u00e1nh m\u1edbi, ch\u00fang ta c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh <\/span><b>git branch<\/b><span style=\"font-weight: 400;\">, v\u00e0 s\u1eed d\u1ee5ng <\/span><b>git checkout<\/b><span style=\"font-weight: 400;\"> khi mu\u1ed1n chuy\u1ec3n sang l\u00e0m vi\u1ec7c \u1edf nh\u00e1nh \u0111\u00f3.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">\u1ede tr\u01b0\u1eddng h\u1ee3p n\u00e0y, ch\u00fang ta c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng t\u00f9y ch\u1ecdn <strong>-b<\/strong> v\u1edbi <strong>git checkout<\/strong> \u0111\u1ec3 th\u1ef1c hi\u1ec7n \u0111\u1ed3ng th\u1eddi hai c\u00f4ng vi\u1ec7c n\u00e0y:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -b &lt;t\u00ean nh\u00e1nh&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 \u0111\u1ec3 t\u1ea1o v\u00e0 chuy\u1ec3n sang l\u00e0m vi\u1ec7c tr\u00ean nh\u00e1nh feat\/user, ta s\u1eed d\u1ee5ng c\u00fa ph\u00e1p sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -b feat\/user<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-chuy\u1ec3n-sang-cac-tag\"><b>Chuy\u1ec3n sang c\u00e1c tag<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\"><strong>Tag trong git<\/strong> l\u00e0 m\u1ed9t c\u00e1ch \u0111\u1ec3 \u0111\u00e1nh d\u1ea5u c\u00e1c v\u1ecb tr\u00ed c\u1ee5 th\u1ec3 trong l\u1ecbch s\u1eed commit. N\u00f3 th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 l\u01b0u l\u1ea1i c\u00e1c phi\u00ean b\u1ea3n quan tr\u1ecdng trong m\u00e3 ngu\u1ed3n nh\u01b0 phi\u00ean b\u1ea3n Release. \u0110\u1ec3 chuy\u1ec3n \u0111\u1ed5i sang tr\u1ea1ng th\u00e1i c\u1ee7a c\u00e1c tags, ta c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng git checkout t\u01b0\u01a1ng t\u1ef1 nh\u01b0 khi s\u1eed d\u1ee5ng v\u1edbi c\u00e1c nh\u00e1nh.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout &lt;t\u00ean tag&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, trong m\u00e3 ngu\u1ed3n \u0111ang c\u00f3 c\u00e1c tags nh\u01b0 v1.0, v1.1, v2.0. \u0110\u1ec3 chuy\u1ec3n \u0111\u1ebfn tr\u1ea1ng th\u00e1i c\u1ee7a tag v1.0, ta s\u1eed d\u1ee5ng c\u00fa ph\u00e1p sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout v1.0<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-hoan-tac-cac-thay-d\u1ed5i-tren-t\u1eadp-tin\"><b>Ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i tr\u00ean t\u1eadp tin<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong qu\u00e1 tr\u00ecnh l\u00e0m vi\u1ec7c tr\u00ean t\u1eadp tin, b\u1ea1n c\u00f3 th\u1ec3 ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i ch\u01b0a \u0111\u01b0\u1ee3c commit tr\u00ean t\u1eadp tin b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng l\u1ec7nh git checkout. \u0110i\u1ec1u n\u00e0y ngh\u0129a l\u00e0 kh\u00f4i ph\u1ee5c tr\u1ea1ng th\u00e1i c\u1ee7a t\u1eadp tin v\u1ec1 tr\u1ea1ng th\u00e1i c\u1ee7a commit cu\u1ed1i c\u00f9ng.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -- &lt;t\u00ean t\u1eadp tin&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, \u0111\u1ec3 ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i tr\u00ean t\u1eadp tin index.html<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -- index.html<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ngo\u00e0i ra, \u0111\u1ec3 ho\u00e0n t\u00e1c nhi\u1ec1u t\u1eadp tin, ta s\u1eed d\u1ee5ng c\u00fa ph\u00e1p sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -- &lt;t\u00ean t\u1eadp tin 1&gt; &lt;t\u00ean t\u1eadp tin 2&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ho\u1eb7c \u0111\u1ec3 ho\u00e0n t\u00e1c tr\u1ea1ng th\u00e1i c\u1ee7a to\u00e0n b\u1ed9 t\u1eadp tin trong th\u01b0 m\u1ee5c l\u00e0m vi\u1ec7c hi\u1ec7n t\u1ea1i:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -- .<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">K\u1ec3 t\u1eeb phi\u00ean b\u1ea3n 2.23, Git \u0111\u00e3 b\u1ed5 sung l\u1ec7nh <\/span><b>git restore <\/b><span style=\"font-weight: 400;\">\u0111\u1ec3 thay th\u1ebf ch\u1ee9c n\u0103ng ho\u00e0n t\u00e1c thay \u0111\u1ed5i n\u00e0y c\u1ee7a Git. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng git restore \u0111\u1ec3 kh\u00f4i ph\u1ee5c t\u1eadp tin v\u1ec1 tr\u1ea1ng th\u00e1i tr\u01b0\u1edbc khi thay \u0111\u1ed5i b\u1eb1ng c\u00fa ph\u00e1p<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git restore &lt;t\u00ean t\u1eadp tin&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ho\u1eb7c to\u00e0n b\u1ed9 t\u1eadp tin trong th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git restore .<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-detached-head-xem-l\u1ea1i-n\u1ed9i-dung-c\u1ee7a-m\u1ed9t-snapshot\"><b>Detached HEAD (xem l\u1ea1i n\u1ed9i dung c\u1ee7a m\u1ed9t snapshot)<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Detached HEAD l\u00e0 tr\u01b0\u1eddng h\u1ee3p HEAD kh\u00f4ng tr\u1ecf v\u00e0o m\u1ed9t nh\u00e1nh c\u1ee5 th\u1ec3 m\u00e0 tr\u1ecf tr\u1ef1c ti\u1ebfp \u0111\u1ebfn m\u1ed9t commit. \u0110i\u1ec1u n\u00e0y s\u1ebd l\u00e0m t\u00e1ch bi\u1ec7t tr\u1ea1ng th\u00e1i l\u00e0m vi\u1ec7c kh\u1ecfi c\u00e1c nh\u00e1nh, gi\u00fap b\u1ea1n c\u00f3 th\u1ec3 th\u1eed nghi\u1ec7m, xem l\u1ea1i m\u00e3 ngu\u1ed3n, ho\u1eb7c ki\u1ec3m tra c\u00e1c thay \u0111\u1ed5i m\u00e0 kh\u00f4ng l\u00e0m \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn nh\u00e1nh n\u00e0o c\u1ea3.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout &lt;commit-hash&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, trong nh\u00e1nh develop \u0111ang c\u00f3 3 commit v\u1edbi th\u00f4ng tin m\u00e3 \u0111\u1ecbnh hash nh\u01b0 sau:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1142\" height=\"634\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-1-vippro.png\" alt=\"git checkout - itviec blog\" class=\"wp-image-82236\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-1-vippro.png 1142w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-1-vippro-300x167.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-1-vippro-700x389.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-1-vippro-200x111.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-1-vippro-100x56.png 100w\" sizes=\"auto, (max-width: 1142px) 100vw, 1142px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 chuy\u1ec3n tr\u1ea1ng th\u00e1i l\u00e0m vi\u1ec7c sang commit c\u00f3 t\u00ean \u201cinit\u201d, ta s\u1eed d\u1ee5ng c\u00fa ph\u00e1p sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout 9b1a833f0a4238f49e5775ed583ba7c55ed38832<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-khoi-ph\u1ee5c-hanh-d\u1ed9ng-khi-k\u1ebft-h\u1ee3p-v\u1edbi-git-reflog\"><b>Kh\u00f4i ph\u1ee5c h\u00e0nh \u0111\u1ed9ng khi k\u1ebft h\u1ee3p v\u1edbi git reflog<\/b><\/h3>\n\n\n\n<p><b>Git reflog<\/b><span style=\"font-weight: 400;\"> l\u00e0 m\u1ed9t l\u1ec7nh c\u1ef1c k\u00ec m\u1ea1nh m\u1ebd v\u00e0 h\u1eefu d\u1ee5ng trong Git. Khi s\u1eed d\u1ee5ng <\/span><b>Git reflog<\/b><span style=\"font-weight: 400;\">, ta c\u00f3 th\u1ec3 xem l\u1ea1i danh s\u00e1ch c\u00e1c ho\u1ea1t \u0111\u1ed9ng \u0111\u00e3 di\u1ec5n ra trong m\u00e3 ngu\u1ed3n nh\u01b0 th\u00eam commit m\u1edbi, x\u00f3a nh\u00e1nh, t\u1ea1o nh\u00e1nh, x\u00f3a commit,&#8230;<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1790\" height=\"370\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-2-vippro.png\" alt=\"git checkout - itviec blog\" class=\"wp-image-82238\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-2-vippro.png 1790w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-2-vippro-300x62.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-2-vippro-1600x331.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-2-vippro-200x41.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-2-vippro-100x21.png 100w\" sizes=\"auto, (max-width: 1790px) 100vw, 1790px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">K\u1ebft qu\u1ea3 t\u1eeb git reflog s\u1ebd hi\u1ec3n th\u1ecb m\u1ed9t danh s\u00e1ch c\u00e1c h\u00e0nh \u0111\u1ed9ng g\u1ea7n \u0111\u00e2y c\u1ee7a HEAD c\u00f9ng v\u1edbi c\u00e1c commit hash. Ch\u00fang ta c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng <\/span><b>git checkout <\/b><span style=\"font-weight: 400;\">\u0111\u1ec3 chuy\u1ec3n \u0111\u1ebfn tr\u1ea1ng th\u00e1i t\u1eadp tin t\u1ea1i th\u1eddi \u0111i\u1ec3m c\u1ee5 th\u1ec3 b\u1eb1ng c\u00fa ph\u00e1p sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout &lt;<\/span><span style=\"font-weight: 400;\">hash<\/span><span style=\"font-weight: 400;\">&gt;<\/span><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Kh\u00f4i ph\u1ee5c nh\u00e1nh \u0111\u00e3 b\u1ecb x\u00f3a: T\u00ecm \u0111\u1ebfn d\u00f2ng ch\u1ee9a th\u00f4ng tin l\u1ec7nh x\u00f3a nh\u00e1nh, sau \u0111\u00f3 s\u1eed d\u1ee5ng git checkout v\u1edbi commit hash tr\u01b0\u1edbc d\u00f2ng n\u00e0y \u0111\u1ec3 quay tr\u1edf l\u1ea1i tr\u1ea1ng th\u00e1i tr\u01b0\u1edbc khi x\u00f3a nh\u00e1nh<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Kh\u00f4i ph\u1ee5c commit b\u1ecb x\u00f3a: T\u00ecm \u0111\u1ebfn d\u00f2ng ch\u1ee9a th\u00f4ng tin l\u1ec7nh x\u00f3a commit (v\u00ed d\u1ee5: <code>git reset --hard HEAD~1<\/code>), sau \u0111\u00f3 d\u00f9ng git checkout v\u1edbi commit hash tr\u01b0\u1edbc \u0111\u00f3.<\/span><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-l\u1ed7i-th\u01b0\u1eddng-g\u1eb7p-khi-lam-vi\u1ec7c-v\u1edbi-git-checkout\"><span class=\"ez-toc-section\" id=\"Cac_loi_thuong_gap_khi_lam_viec_voi_Git_Checkout\"><\/span><b>C\u00e1c l\u1ed7i th\u01b0\u1eddng g\u1eb7p khi l\u00e0m vi\u1ec7c v\u1edbi Git Checkout<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-l\u1ed7i-pathspec-did-not-match-any-file-s-known-to-git\"><b>L\u1ed7i \u201cpathspec \u2026 did not match any file(s) known to git\u201d<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Khi b\u1ea1n s\u1eed d\u1ee5ng <\/span><b>git checkout <\/b><span style=\"font-weight: 400;\">sang m\u1ed9t nh\u00e1nh ho\u1eb7c m\u1ed9t commit kh\u00f4ng t\u1ed3n t\u1ea1i ho\u1eb7c \u0111\u00e3 b\u1ecb x\u00f3a trong repository, b\u1ea1n s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c m\u1ed9t tin nh\u1eafn l\u1ed7i v\u1edbi n\u1ed9i dung c\u00f3 d\u1ea1ng nh\u01b0 sau:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"90\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-3-vippro.png\" alt=\"git checkout - itviec blog\" class=\"wp-image-82239\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-3-vippro.png 1080w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-3-vippro-300x25.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-3-vippro-700x58.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-3-vippro-200x17.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-3-vippro-100x8.png 100w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 kh\u1eafc ph\u1ee5c t\u00ecnh tr\u1ea1ng n\u00e0y, b\u1ea1n c\u1ea7n ki\u1ec3m tra l\u1ea1i t\u00ean nh\u00e1nh ho\u1eb7c t\u00ean tag m\u00e0 b\u1ea1n mu\u1ed1n checkout \u0111\u00e3 ch\u00ednh x\u00e1c hay ch\u01b0a. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git branch<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ho\u1eb7c<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git tag<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0111\u1ec3 xem l\u1ea1i danh s\u00e1ch nh\u00e1nh ho\u1eb7c tag.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-khong-th\u1ec3-checkout-do-co-t\u1eadp-tin-thay-d\u1ed5i\"><b>Kh\u00f4ng th\u1ec3 checkout do c\u00f3 t\u1eadp tin thay \u0111\u1ed5i<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u1ed7i x\u1ea3y ra khi b\u1ea1n \u0111ang c\u1ed1 g\u1eafng checkout t\u1eeb m\u1ed9t nh\u00e1nh l\u00e0m vi\u1ec7c \u0111ang c\u00f3 nh\u1eefng thay \u0111\u1ed5i tr\u00ean t\u1eadp tin, tuy nhi\u00ean ch\u00fang ch\u01b0a \u0111\u01b0\u1ee3c commit. Git y\u00eau c\u1ea7u b\u1ea1n ph\u1ea3i commit ho\u1eb7c l\u01b0u t\u1ea1m th\u1eddi (git stash) c\u00e1c thay \u0111\u1ed5i n\u00e0y tr\u01b0\u1edbc khi chuy\u1ec3n nh\u00e1nh \u0111\u1ec3 tr\u00e1nh xung \u0111\u1ed9t m\u00e3 ngu\u1ed3n v\u00e0 m\u1ea5t d\u1eef li\u1ec7u.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1344\" height=\"516\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-4-vippro.png\" alt=\"git checkout - itviec blog\" class=\"wp-image-82240\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-4-vippro.png 1344w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-4-vippro-300x115.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-4-vippro-700x269.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-4-vippro-200x77.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-4-vippro-100x38.png 100w\" sizes=\"auto, (max-width: 1344px) 100vw, 1344px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 tr\u00e1nh t\u00ecnh tr\u1ea1ng n\u00e0y, b\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n commit l\u1ea1i c\u00e1c thay \u0111\u1ed5i:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git add .<\/span>\n<span style=\"font-weight: 400;\">git commit -m <\/span><span style=\"font-weight: 400;\">\"commit message\"<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ho\u1eb7c l\u01b0u t\u1ea1m th\u1eddi c\u00e1c thay \u0111\u1ed5i:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git stash<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-l\u1ed7i-detached-head\"><b>L\u1ed7i Detached HEAD<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Khi b\u1ea1n s\u1eed d\u1ee5ng git checkout \u0111\u1ec3 chuy\u1ec3n \u0111\u1ebfn m\u1ed9t commit ho\u1eb7c m\u1ed9t tag c\u1ee5 th\u1ec3 thay v\u00ec m\u1ed9t nh\u00e1nh, th\u00ec l\u00fac n\u00e0y b\u1ea1n \u0111\u00e3 t\u00e1ch bi\u1ec7t kh\u1ecfi d\u00f2ng l\u00e0m vi\u1ec7c hi\u1ec7n t\u1ea1i, kh\u00f4ng c\u00f2n li\u00ean k\u1ebft v\u00e0o m\u1ed9t nh\u00e1nh n\u00e0o. L\u00fac n\u00e0y Git s\u1ebd c\u1ea3nh b\u00e1o b\u1ea1n \u0111ang trong tr\u1ea1ng th\u00e1i detached HEAD.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1410\" height=\"240\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-5-vippro.png\" alt=\"git checkout - itviec blog\" class=\"wp-image-82241\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-5-vippro.png 1410w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-5-vippro-300x51.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-5-vippro-700x119.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-5-vippro-200x34.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/git-checkout-5-vippro-100x17.png 100w\" sizes=\"auto, (max-width: 1410px) 100vw, 1410px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 tho\u00e1t kh\u1ecfi Detached HEAD, b\u1ea1n c\u00f3 th\u1ec3 chuy\u1ec3n v\u1ec1 m\u1ed9t nh\u00e1nh c\u1ee5 th\u1ec3 trong repository.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-cau-h\u1ecfi-th\u01b0\u1eddng-g\u1eb7p-v\u1ec1-git-checkout\"><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_thuong_gap_ve_Git_Checkout\"><\/span><b>C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Git Checkout<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-so-sanh-git-checkout-va-git-switch\"><b>So s\u00e1nh git checkout v\u00e0 git switch<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Git switch l\u00e0 m\u1ed9t l\u1ec7nh m\u1edbi, \u0111\u01b0\u1ee3c b\u1ed5 sung t\u1eeb phi\u00ean b\u1ea3n git 2.23 \u0111\u1ec3 thay th\u1ebf nhi\u1ec7m v\u1ee5 chuy\u1ec3n \u0111\u1ed5i gi\u1eefa c\u00e1c nh\u00e1nh c\u1ee7a git checkout. Tuy nhi\u00ean, git checkout v\u1eabn \u0111\u00f3ng m\u1ed9t vai tr\u00f2 quan tr\u1ecdng v\u00ec s\u1ef1 \u0111a nhi\u1ec7m c\u1ee7a n\u00f3. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 m\u1ed9t s\u1ed1 \u0111i\u1ec3m so s\u00e1nh gi\u1eefa hai l\u1ec7nh n\u00e0y:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><b>Ti\u00eau ch\u00ed<\/b><\/td><td><b>Git checkout<\/b><\/td><td><b>Git switch<\/b><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">Chuy\u1ec3n \u0111\u1ed5i gi\u1eefa c\u00e1c nh\u00e1nh<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">T\u1ea1o nh\u00e1nh m\u1edbi v\u00e0 chuy\u1ec3n sang nh\u00e1nh \u0111\u00f3<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">Ho\u00e0n t\u00e1c thay \u0111\u1ed5i c\u1ee7a t\u1eadp tin<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3<\/span><\/td><td><span style=\"font-weight: 400;\">Kh\u00f4ng<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">Detached HEAD<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3<\/span><\/td><td><span style=\"font-weight: 400;\">Kh\u00f4ng<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">Kh\u1ea3 n\u0103ng s\u1eed d\u1ee5ng<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 b\u1ecb nh\u1ea7m l\u1eabn do \u0111a d\u1ee5ng<\/span><\/td><td><span style=\"font-weight: 400;\">D\u1ec5 s\u1eed d\u1ee5ng v\u00ec ch\u1ec9 t\u1eadp trung v\u00e0o m\u1ed9t ch\u1ee9c n\u0103ng chuy\u1ec3n nh\u00e1nh<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-so-sanh-git-checkout-va-git-reset-head-hard\"><b>So s\u00e1nh \u201cgit checkout &#8212; .\u201d v\u00e0 \u201cgit reset HEAD &#8211;hard\u201d<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Hai c\u00fa ph\u00e1p n\u00e0y \u0111\u1ec3 d\u00f9ng \u0111\u1ec3 ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i x\u1ea3y ra tr\u00ean th\u01b0 m\u1ee5c l\u00e0m vi\u1ec7c hi\u1ec7n t\u1ea1i. Tuy nhi\u00ean gi\u1eefa ch\u00fang c\u00f3 nh\u1eefng kh\u00e1c bi\u1ec7t quan tr\u1ecdng v\u1ec1 nguy\u00ean l\u00fd ho\u1ea1t \u0111\u1ed9ng v\u00e0 ph\u1ea1m vi \u1ea3nh h\u01b0\u1edfng.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><b>Ti\u00eau ch\u00ed<\/b><\/td><td><b>git checkout &#8212; .<\/b><\/td><td><b>git reset HEAD &#8211;hard<\/b><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">Ph\u1ea1m vi \u1ea3nh h\u01b0\u1edfng<\/span><\/td><td><span style=\"font-weight: 400;\">Ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i ch\u01b0a \u0111\u01b0\u1ee3c commit trong th\u01b0 m\u1ee5c l\u00e0m vi\u1ec7c<\/span><\/td><td><span style=\"font-weight: 400;\">Ho\u00e0n t\u00e1c m\u1ecdi thay \u0111\u1ed5i trong c\u1ea3 th\u01b0 m\u1ee5c l\u00e0m vi\u1ec7c v\u00e0 v\u00f9ng staging, \u0111\u1ed3ng th\u1eddi lo\u1ea1i b\u1ecf commit sau v\u1ecb tr\u00ed HEAD.<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">L\u1ecbch s\u1eed commit<\/span><\/td><td><span style=\"font-weight: 400;\">Kh\u00f4ng g\u00e2y \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn l\u1ecbch s\u1eed commit<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 x\u00f3a b\u1ecf commit n\u1ebfu s\u1eed d\u1ee5ng HEAD v\u1edbi t\u00f9y ch\u1ecdn STEP<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">Tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng<\/span><\/td><td><span style=\"font-weight: 400;\">Ch\u1ec9 mu\u1ed1n ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i \u0111\u00e3 x\u1ea3y ra tr\u00ean th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i nh\u01b0ng ch\u01b0a commit<\/span><\/td><td><span style=\"font-weight: 400;\">Mu\u1ed1n ho\u00e0n t\u00e1c c\u00e1c thay \u0111\u1ed5i \u0111\u00e3 \u0111\u01b0\u1ee3c commit v\u00e0o repository.<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-lam-sao-d\u1ec3-chuy\u1ec3n-tr\u1ea1ng-thai-lam-vi\u1ec7c-sang-m\u1ed9t-nhanh-t\u1eeb-xa\"><b>L\u00e0m sao \u0111\u1ec3 chuy\u1ec3n tr\u1ea1ng th\u00e1i l\u00e0m vi\u1ec7c sang m\u1ed9t nh\u00e1nh t\u1eeb xa?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Tr\u01b0\u1edbc ti\u00ean, b\u1ea1n c\u1ea7n c\u1eadp nh\u1eadt c\u00e1c nh\u00e1nh t\u1eeb xa v\u1ec1 kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git fetch -all<\/span>\n<span style=\"font-weight: 400;\">git branch -r <\/span><span style=\"font-weight: 400;\"># hi\u1ec3n th\u1ecb c\u00e1c nh\u00e1nh t\u1eeb xa<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Sau \u0111\u00f3 b\u1ea1n c\u00f3 th\u1ec3 chuy\u1ec3n sang m\u1ed9t nh\u00e1nh t\u1eeb xa b\u1eb1ng l\u1ec7nh:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout &lt;t\u00ean nh\u00e1nh t\u1eeb xa&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ed1i v\u1edbi c\u00e1c phi\u00ean b\u1ea3n git c\u0169, ch\u00fang ta kh\u00f4ng th\u1ec3 chuy\u1ec3n sang l\u00e0m vi\u1ec7c tr\u1ef1c ti\u1ebfp m\u1ed9t nh\u00e1nh t\u1eeb xa, m\u00e0 c\u1ea7n ph\u1ea3i t\u1ea1o m\u1ed9t nh\u00e1nh c\u1ee5c b\u1ed9 d\u1ef1a tr\u00ean nh\u00e1nh t\u1eeb xa b\u1eb1ng l\u1ec7nh sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -b &lt;nh\u00e1nh c\u1ee5c b\u1ed9&gt; &lt;t\u00ean kho l\u01b0u tr\u1eef t\u1eeb xa&gt;\/&lt;t\u00ean nh\u00e1nh t\u1eeb xa&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5: \u0111\u1ec3 chuy\u1ec3n sang nh\u00e1nh develop \u1edf kho l\u01b0u tr\u1eef t\u1eeb xa, ta s\u1eed d\u1ee5ng:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git fetch -all<\/span>\n<span style=\"font-weight: 400;\">git checkout develop<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ho\u1eb7c<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout -b develop origin\/develop<\/span><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-k\u1ebft-git-checkout\"><span class=\"ez-toc-section\" id=\"Tong_ket_Git_Checkout\"><\/span><b>T\u1ed5ng k\u1ebft Git Checkout<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git checkout l\u00e0 m\u1ed9t l\u1ec7nh \u0111a d\u1ee5ng v\u00e0 quan tr\u1ecdng trong Git. Qua b\u00e0i vi\u1ebft n\u00e0y, ITviec hi v\u1ecdng \u0111\u00e3 cung c\u1ea5p c\u00e1c th\u00f4ng tin h\u1eefu \u00edch \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 n\u1eafm v\u1eefng \u0111\u01b0\u1ee3c c\u00e1ch s\u1eed d\u1ee5ng Git checkout trong c\u00e1c tr\u01b0\u1eddng h\u1ee3p th\u1ef1c t\u1ebf. T\u1eeb \u0111\u00f3 t\u1ea1o ti\u1ec1n \u0111\u1ec1 \u0111\u1ec3 b\u1ea1n t\u1eebng b\u01b0\u1edbc chinh ph\u1ee5c \u0111\u01b0\u1ee3c c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n m\u1ea1nh m\u1ebd Git, mang l\u1ea1i nhi\u1ec1u c\u01a1 h\u1ed9i vi\u1ec7c l\u00e0m h\u01a1n.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang ta s\u1ebd c\u00f9ng t\u00ecm hi\u1ec3u v\u1ec1 Git Checkout, m\u1ed9t l\u1ec7nh quan tr\u1ecdng v\u1edbi nhi\u1ec1u ch\u1ee9c n\u0103ng trong Git nh\u01b0 chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh, chuy\u1ec3n \u0111\u1ed5i tag, ho\u00e0n t\u00e1c,&#8230; c\u00f9ng c\u00e1c l\u1ec7nh Git thay th\u1ebf cho m\u1ed9t v\u00e0i tr\u01b0\u1eddng h\u1ee3p. \u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1: Git l\u00e0 g\u00ec? [&hellip;]<\/p>\n","protected":false},"author":235,"featured_media":82237,"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-82085","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 Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft - ITviec Blog<\/title>\n<meta name=\"description\" content=\"T\u00ecm hi\u1ec3u Git Checkout v\u00e0 c\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng nh\u01b0 chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh, chuy\u1ec3n \u0111\u1ed5i tag, ho\u00e0n t\u00e1c,... chi ti\u1ebft k\u00e8m v\u00ed d\u1ee5 c\u1ee5 th\u1ec3.\" \/>\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\/git-checkout-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft\" \/>\n<meta property=\"og:description\" content=\"Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang ta s\u1ebd c\u00f9ng t\u00ecm hi\u1ec3u v\u1ec1 Git Checkout, m\u1ed9t l\u1ec7nh quan tr\u1ecdng v\u1edbi nhi\u1ec1u ch\u1ee9c n\u0103ng trong Git nh\u01b0 chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh, chuy\u1ec3n \u0111\u1ed5i tag,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/git-checkout-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-28T08:09:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-10T03:44:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-Checkout-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=\"12 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Git Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft - ITviec Blog","description":"T\u00ecm hi\u1ec3u Git Checkout v\u00e0 c\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng nh\u01b0 chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh, chuy\u1ec3n \u0111\u1ed5i tag, ho\u00e0n t\u00e1c,... chi ti\u1ebft k\u00e8m v\u00ed d\u1ee5 c\u1ee5 th\u1ec3.","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\/git-checkout-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"Git Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft","og_description":"Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang ta s\u1ebd c\u00f9ng t\u00ecm hi\u1ec3u v\u1ec1 Git Checkout, m\u1ed9t l\u1ec7nh quan tr\u1ecdng v\u1edbi nhi\u1ec1u ch\u1ee9c n\u0103ng trong Git nh\u01b0 chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh, chuy\u1ec3n \u0111\u1ed5i tag,","og_url":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2024-11-28T08:09:14+00:00","article_modified_time":"2025-07-10T03:44:36+00:00","og_image":[{"width":1500,"height":790,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-Checkout-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":"12 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/"},"author":{"name":"Ph\u1ea1m H\u1eefu Ng\u1ecdc","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/407769a7625b7f955cef615f7a99abad"},"headline":"Git Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft","datePublished":"2024-11-28T08:09:14+00:00","dateModified":"2025-07-10T03:44:36+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/"},"wordCount":2859,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-Checkout-vippro.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/","url":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/","name":"Git Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-Checkout-vippro.jpg","datePublished":"2024-11-28T08:09:14+00:00","dateModified":"2025-07-10T03:44:36+00:00","description":"T\u00ecm hi\u1ec3u Git Checkout v\u00e0 c\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng nh\u01b0 chuy\u1ec3n \u0111\u1ed5i nh\u00e1nh, chuy\u1ec3n \u0111\u1ed5i tag, ho\u00e0n t\u00e1c,... chi ti\u1ebft k\u00e8m v\u00ed d\u1ee5 c\u1ee5 th\u1ec3.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/git-checkout-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/git-checkout-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-Checkout-vippro.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/11\/Git-Checkout-vippro.jpg","width":1500,"height":790,"caption":"Git Checkout - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/git-checkout-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 Checkout: C\u00e1c tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng k\u00e8m v\u00ed d\u1ee5 chi ti\u1ebft"}]},{"@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\/82085","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=82085"}],"version-history":[{"count":2,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/82085\/revisions"}],"predecessor-version":[{"id":89226,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/82085\/revisions\/89226"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/82237"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=82085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=82085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=82085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}