{"id":82652,"date":"2024-12-19T11:30:37","date_gmt":"2024-12-19T04:30:37","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=82652"},"modified":"2025-07-10T10:46:05","modified_gmt":"2025-07-10T03:46:05","slug":"git-rebase-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/","title":{"rendered":"Git rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao"},"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-rebase-la-gi\/#Nhanh_trong_Git_Git_branch_la_gi\" >Nh\u00e1nh trong Git (Git branch) 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-rebase-la-gi\/#Git_rebase_la_gi\" >Git rebase 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-rebase-la-gi\/#Co_che_hoat_dong_cua_Git_Rebase\" >C\u01a1 ch\u1ebf ho\u1ea1t \u0111\u1ed9ng c\u1ee7a Git Rebase<\/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-rebase-la-gi\/#Uu_diem_va_nhuoc_diem_cua_git_rebase\" >\u01afu \u0111i\u1ec3m v\u00e0 nh\u01b0\u1ee3c \u0111i\u1ec3m c\u1ee7a git rebase<\/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-rebase-la-gi\/#Quy_trinh_thuc_hien_Git_Rebase\" >Quy tr\u00ecnh th\u1ef1c hi\u1ec7n Git Rebase<\/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-rebase-la-gi\/#So_sanh_Git_rebase_va_Git_merge\" >So s\u00e1nh Git rebase v\u00e0 Git merge<\/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\/git-rebase-la-gi\/#Cac_tuy_chon_nang_cao_cua_git_rebase\" >C\u00e1c t\u00f9y ch\u1ecdn n\u00e2ng cao c\u1ee7a git rebase<\/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\/git-rebase-la-gi\/#Cac_cau_hoi_thuong_gap_ve_Git_rebase\" >C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Git rebase<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/#Tong_ket\" >T\u1ed5ng k\u1ebft<\/a><\/li><\/ul><\/nav><\/div>\n\n<p><em><strong>Git l\u00e0 m\u1ed9t trong nh\u1eefng c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n ph\u1ed5 bi\u1ebfn. \u0110i\u1ec3m n\u1ed5i b\u1eadt c\u1ee7a Git n\u1eb1m \u1edf kh\u1ea3 n\u0103ng ph\u00e2n t\u00e1ch v\u00e0 h\u1ee3p nh\u1ea5t nh\u00e1nh, gi\u00fap n\u00e2ng cao hi\u1ec7u qu\u1ea3 trong qu\u00e1 tr\u00ecnh c\u1ed9ng t\u00e1c, l\u00e0m vi\u1ec7c nh\u00f3m. Git rebase ch\u00ednh l\u00e0 m\u1ed9t trong nh\u1eefng ph\u01b0\u01a1ng ph\u00e1p hi\u1ec7u qu\u1ea3 \u0111\u1ec3 th\u1ef1c hi\u1ec7n h\u1ee3p nh\u1ea5t thay \u0111\u1ed5i gi\u1eefa c\u00e1c nh\u00e1nh.<\/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 rebase l\u00e0 g\u00ec?<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u01a1 ch\u1ebf ho\u1ea1t \u0111\u1ed9ng c\u1ee7a git rebase<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">\u01afu v\u00e0 nh\u01b0\u1ee3c \u0111i\u1ec3m c\u1ee7a git rebase<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Quy tr\u00ecnh th\u1ef1c hi\u1ec7n git rebase<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u00e1c t\u00f9y ch\u1ecdn n\u00e2ng cao khi s\u1eed d\u1ee5ng git rebase<\/span><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-nhanh-trong-git-git-branch-la-gi\"><span class=\"ez-toc-section\" id=\"Nhanh_trong_Git_Git_branch_la_gi\"><\/span><b>Nh\u00e1nh trong Git (Git branch) l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-nhanh-trong-git-la-gi\"><b>Nh\u00e1nh trong git l\u00e0 g\u00ec?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Nh\u00e1nh trong git th\u1ef1c ch\u1ea5t l\u00e0 m\u1ed9t con tr\u1ecf \u0111\u1ec3 tr\u1ecf \u0111\u1ebfn \u201csnapshot\u201d c\u00e1c thay \u0111\u1ed5i trong kho l\u01b0u tr\u1eef, m\u00e0 \u1edf trong \u0111\u00f3, b\u1ea1n c\u00f3 th\u1ec3 th\u00eam c\u00e1c commits m\u1edbi nh\u01b0ng kh\u00f4ng l\u00e0m \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn nh\u00e1nh ch\u00ednh (m\u1eb7c \u0111\u1ecbnh nh\u00e1nh ch\u00ednh s\u1ebd l\u00e0 main).<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1656\" height=\"444\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro.png\" alt=\"git rebase - itviec blog\" class=\"wp-image-83074\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro.png 1656w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-300x80.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-640x172.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-200x54.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-768x206.png 768w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-1536x412.png 1536w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-100x27.png 100w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-700x188.png 700w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-1-vippro-1600x429.png 1600w\" sizes=\"auto, (max-width: 1656px) 100vw, 1656px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-phan-nhanh-va-h\u1ee3p-nh\u1ea5t-nhanh-trong-git\"><b>Ph\u00e2n nh\u00e1nh v\u00e0 h\u1ee3p nh\u1ea5t nh\u00e1nh trong git<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Khi b\u1ea1n mu\u1ed1n th\u00eam m\u1ed9t t\u00ednh n\u0103ng m\u1edbi ho\u1eb7c s\u1eeda l\u1ed7i hay b\u1ea5t k\u1ec3 nh\u1eefng c\u1eadp nh\u1eadt n\u00e0o trong m\u00e3 ngu\u1ed3n, b\u1ea1n s\u1ebd t\u1ea1o m\u1ed9t nh\u00e1nh m\u1edbi \u0111\u1ec3 \u0111\u00f3ng g\u00f3i c\u00e1c thay \u0111\u1ed5i c\u1ee7a m\u00ecnh.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Vi\u1ec7c n\u00e0y gi\u00fap t\u00e1ch bi\u1ec7t qu\u00e1 tr\u00ecnh thay \u0111\u1ed5i v\u00e0 tr\u00e1nh \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn nh\u00e1nh ch\u00ednh. \u0110i\u1ec1u n\u00e0y r\u1ea5t h\u1eefu \u00edch khi trong m\u1ed9t nh\u00f3m l\u00e0m vi\u1ec7c c\u00f3 nhi\u1ec1u ng\u01b0\u1eddi c\u00f9ng ph\u00e1t tri\u1ec3n m\u00e3 ngu\u1ed3n.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"914\" height=\"435\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro.png\" alt=\"git rebase - itviec blog\" class=\"wp-image-83075\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro.png 914w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro-300x143.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro-640x305.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro-200x95.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro-768x366.png 768w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro-100x48.png 100w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-2-vippro-700x333.png 700w\" sizes=\"auto, (max-width: 914px) 100vw, 914px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">Sau khi ho\u00e0n th\u00e0nh c\u00e1c thay \u0111\u1ed5i m\u1edbi, b\u1ea1n c\u00f3 th\u1ec3 h\u1ee3p nh\u1ea5t nh\u1eefng n\u1ed9i dung n\u00e0y v\u00e0o nh\u00e1nh ch\u00ednh m\u1ed9t c\u00e1ch nhanh ch\u00f3ng v\u00e0 an to\u00e0n b\u1eb1ng c\u00e1c ph\u01b0\u01a1ng ph\u00e1p nh\u01b0 <strong>git merge<\/strong>, <strong>git rebase<\/strong>. \u0110i\u1ec1u n\u00e0y gi\u00fap vi\u1ec7c qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n tr\u1edf n\u00ean hi\u1ec7u qu\u1ea3 h\u01a1n trong c\u00e1c d\u1ef1 \u00e1n l\u1edbn.<\/span><\/p>\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\/git-merge-la-gi\/\" target=\"_blank\" rel=\"noopener\"><strong>Git Merge: H\u01b0\u1edbng d\u1eabn chi ti\u1ebft c\u00e1ch s\u1eed d\u1ee5ng Git Merge<\/strong><\/a><\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-git-rebase-la-gi\"><span class=\"ez-toc-section\" id=\"Git_rebase_la_gi\"><\/span><b>Git rebase l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase l\u00e0 m\u1ed9t l\u1ec7nh m\u1ea1nh m\u1ebd trong git \u0111\u1ec3 h\u1ee3p nh\u1ea5t c\u00e1c thay \u0111\u1ed5i t\u1eeb nh\u00e1nh n\u00e0y sang nh\u00e1nh kh\u00e1c b\u1eb1ng vi\u1ec7c t\u00e1i s\u1eafp x\u1ebfp l\u1ea1i l\u1ecbch s\u1eed commits. Git rebase s\u1ebd \u0111\u01b0a nh\u1eefng commit m\u1edbi c\u1ee7a nh\u00e1nh hi\u1ec7n t\u1ea1i l\u00ean ph\u00eda \u0111\u1ea7u trong l\u1ecbch s\u1eed commit v\u00e0 t\u1ea1o ra m\u1ed9t l\u1ecbch s\u1eed commit tuy\u1ebfn t\u00ednh.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">C\u00fa ph\u00e1p c\u01a1 b\u1ea3n c\u1ee7a git rebase:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase &lt;t\u00ean nh\u00e1nh&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase r\u1ea5t ph\u00f9 h\u1ee3p trong nh\u1eefng tr\u01b0\u1eddng h\u1ee3p nh\u01b0:<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">C\u1eadp nh\u1eadt thay \u0111\u1ed5i t\u1eeb nh\u00e1nh g\u1ed1c nh\u01b0ng kh\u00f4ng mu\u1ed1n t\u1ea1o ra commit merge<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Mu\u1ed1n gi\u1eef cho l\u1ecbch s\u1eed commit \u0111\u01b0\u1ee3c g\u1ecdn g\u00e0ng v\u00e0 s\u1ea1ch s\u1ebd: B\u1edfi v\u00ec c\u01a1 ch\u1ebf t\u00e1i t\u1ea1o m\u1ed9t l\u1ecbch s\u1eed commit tuy\u1ebfn t\u00ednh v\u00e0 kh\u00f4ng t\u1ea1o ra commit merge n\u00ean git rebase r\u1ea5t ph\u00f9 h\u1ee3p cho nh\u1eefng d\u1ef1 \u00e1n c\u1ea7n gi\u1eef l\u1ecbch s\u1eed \u0111\u01a1n gi\u1ea3n v\u00e0 g\u1ecdn g\u00e0ng.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">C\u1ea7n t\u00e1i s\u1eed d\u1ee5ng m\u1ed9t nh\u00e1nh ho\u1eb7c s\u1eafp x\u1ebfp l\u1ea1i commit tr\u00ean m\u1ed9t commit base m\u1edbi.<\/span><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-c\u01a1-ch\u1ebf-ho\u1ea1t-d\u1ed9ng-c\u1ee7a-git-rebase\"><span class=\"ez-toc-section\" id=\"Co_che_hoat_dong_cua_Git_Rebase\"><\/span><b> C\u01a1 ch\u1ebf ho\u1ea1t \u0111\u1ed9ng c\u1ee7a Git Rebase<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase ho\u1ea1t \u0111\u1ed9ng d\u1ef1a tr\u00ean c\u01a1 ch\u1ebf s\u1eafp x\u1ebfp l\u1ea1i l\u1ecbch s\u1eed commit v\u00e0 kh\u00f4ng t\u1ea1o ra commit merge. \u0110i\u1ec1u n\u00e0y s\u1ebd h\u00ecnh th\u00e0nh m\u1ed9t l\u1ecbch s\u1eed commit tuy\u1ebfn t\u00ednh. Chi ti\u1ebft v\u1ec1 c\u00e1ch th\u1ee9c ho\u1ea1t \u0111\u1ed9ng c\u1ee7a git rebase \u0111\u01b0\u1ee3c m\u00f4 t\u1ea3 th\u00f4ng qua v\u00ed d\u1ee5 sau:<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 ta c\u00f3 hai nh\u00e1nh A v\u00e0 nh\u00e1nh B \u0111\u1ec1u c\u00f3 chung commit C1. Tr\u1ea3i qua qu\u00e1 tr\u00ecnh l\u00e0m vi\u1ec7c, nh\u00e1nh A \u0111\u01b0\u1ee3c b\u1ed5 sung th\u00eam commits C2 v\u00e0 C3 t\u1eeb nh\u00e1nh kh\u00e1c, c\u00f2n nh\u00e1nh B t\u1ea1o th\u00eam hai commit C4, C5.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1656\" height=\"444\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro.png\" alt=\"git rebase - itviec blog\" class=\"wp-image-83076\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro.png 1656w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-300x80.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-640x172.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-200x54.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-768x206.png 768w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-1536x412.png 1536w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-100x27.png 100w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-700x188.png 700w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-3-vippro-1600x429.png 1600w\" sizes=\"auto, (max-width: 1656px) 100vw, 1656px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">B\u00e2y gi\u1edd ch\u00fang ta c\u1ea7n th\u1ef1c hi\u1ec7n h\u1ee3p nh\u1ea5t c\u00e1c thay \u0111\u1ed5i t\u1eeb nh\u00e1nh B v\u00e0 nh\u00e1nh A b\u1eb1ng l\u1ec7nh <\/span><b>git rebase<\/b><span style=\"font-weight: 400;\">:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout branch-A<\/span>\n<span style=\"font-weight: 400;\">git rebase branch-B<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ea7u ti\u00ean, Git s\u1ebd t\u00ecm \u0111\u1ebfn commit chung g\u1ea7n nh\u1ea5t (common ancestor commit) gi\u1eefa hai nh\u00e1nh, sau \u0111\u00f3 \u201clo\u1ea1i b\u1ecf\u201d t\u1ea5t c\u1ea3 c\u00e1c commit m\u1edbi tr\u00ean nh\u00e1nh-A \u0111\u00e3 x\u1ea3y ra k\u1ec3 t\u1eeb commit chung v\u00e0 l\u01b0u t\u1ea1m th\u1eddi \u1edf trong b\u1ed9 nh\u1edb.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1692\" height=\"676\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro.png\" alt=\"git rebase - itviec blog\" class=\"wp-image-83077\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro.png 1692w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-300x120.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-640x256.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-200x80.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-768x307.png 768w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-1536x614.png 1536w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-100x40.png 100w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-700x280.png 700w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-4-vippro-1600x639.png 1600w\" sizes=\"auto, (max-width: 1692px) 100vw, 1692px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">Ti\u1ebfp theo, Git \u00e1p d\u1ee5ng c\u00e1c commit m\u1edbi t\u1eeb nh\u00e1nh B v\u00e0o nh\u00e1nh A. T\u1ea1i th\u1eddi \u0111i\u1ec3m n\u00e0y, t\u1ea1m th\u1eddi c\u1ea3 hai nh\u00e1nh th\u1ef1c s\u1ef1 tr\u00f4ng gi\u1ed1ng h\u1ec7t nhau v\u1ec1 l\u1ecbch s\u1eed commit.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1720\" height=\"660\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro.png\" alt=\"git rebase - itviec blog\" class=\"wp-image-83078\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro.png 1720w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-300x115.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-640x246.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-200x77.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-768x295.png 768w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-1536x589.png 1536w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-100x38.png 100w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-700x269.png 700w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-5-vippro-1600x614.png 1600w\" sizes=\"auto, (max-width: 1720px) 100vw, 1720px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">Cu\u1ed1i c\u00f9ng, c\u00e1c commit m\u1edbi t\u1eeb nh\u00e1nh A s\u1ebd \u0111\u01b0\u1ee3c \u0111\u01b0a tr\u1edf l\u1ea1i v\u00e0 \u0111\u01b0\u1ee3c \u0111\u1eb7t \u1edf \u0111\u1ea7u l\u1ecbch s\u1eed commit. V\u00ec ch\u00fang \u0111\u01b0\u1ee3c \u0111\u1eb7t tr\u00ean \u0111\u1ea7u c\u00e1c commit t\u00edch h\u1ee3p t\u1eeb nh\u00e1nh B, n\u00ean \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 \u201cRebased\u201d.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1588\" height=\"422\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro.png\" alt=\"git rebase - itviec blog\" class=\"wp-image-83079\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro.png 1588w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro-300x80.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro-640x170.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro-200x53.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro-768x204.png 768w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro-1536x408.png 1536w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro-100x27.png 100w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-6-vippro-700x186.png 700w\" sizes=\"auto, (max-width: 1588px) 100vw, 1588px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">Nh\u01b0 v\u1eady, qu\u00e1 tr\u00ecnh rebase \u0111\u1ec3 h\u1ee3p nh\u1ea5t c\u00e1c thay \u0111\u1ed5i t\u1eeb nh\u00e1nh B v\u00e0o nh\u00e1nh A \u0111\u00e3 \u0111\u01b0\u1ee3c ho\u00e0n t\u1ea5t. Nh\u00e1nh A v\u1eabn gi\u1eef \u0111\u01b0\u1ee3c m\u1ed9t l\u1ecbch s\u1eed commit tuy\u1ebfn t\u00ednh v\u00e0 kh\u00f4ng t\u1ea1o ra th\u00eam commit merge.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-\u01b0u-di\u1ec3m-va-nh\u01b0\u1ee3c-di\u1ec3m-c\u1ee7a-git-rebase\"><span class=\"ez-toc-section\" id=\"Uu_diem_va_nhuoc_diem_cua_git_rebase\"><\/span><b>\u01afu \u0111i\u1ec3m v\u00e0 nh\u01b0\u1ee3c \u0111i\u1ec3m c\u1ee7a git rebase<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 m\u1ea1nh m\u1ebd trong vi\u1ec7c h\u1ee3p nh\u1ea5t nh\u00e1nh, tuy nhi\u00ean git rebase c\u0169ng s\u1ebd g\u00e2y ra m\u1ed9t s\u1ed1 kh\u00f3 kh\u0103n n\u1ebfu nh\u01b0 kh\u00f4ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u00fang c\u00e1ch.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u01b0u-di\u1ec3m\"><b>\u01afu \u0111i\u1ec3m<\/b><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Gi\u1eef cho l\u1ecbch s\u1eed commit \u0111\u01b0\u1ee3c g\u1ecdn g\u00e0ng: git rebase gi\u00fap h\u1ee3p nh\u1ea5t c\u00e1c commit, t\u1ea1o ra m\u1ed9t l\u1ecbch s\u1eed tuy\u1ebfn t\u00ednh d\u1ec5 \u0111\u1ecdc, \u0111\u1eb7c bi\u1ec7t h\u1eefu \u00edch khi l\u00e0m vi\u1ec7c tr\u00ean c\u00e1c nh\u00e1nh t\u00ednh n\u0103ng ho\u1eb7c s\u1eeda l\u1ed7i nh\u1ecf<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Lo\u1ea1i b\u1ecf c\u00e1c commit merge kh\u00f4ng c\u1ea7n thi\u1ebft: Vi\u1ec7c kh\u00f4ng t\u1ea1o ra commit merge gi\u00fap cho l\u1ecbch s\u1eed commit \u0111\u01b0\u1ee3c \u0111\u01a1n gi\u1ea3n h\u00f3a, tr\u00e1nh nh\u1eefng commit d\u01b0 th\u1eeba<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Vi\u1ec7c theo d\u00f5i c\u00e1c thay \u0111\u1ed5i \u0111\u01b0\u1ee3c d\u1ec5 d\u00e0ng: Git rebase gi\u1eef cho l\u1ecbch s\u1eed commit \u0111\u01b0\u1ee3c tuy\u1ebfn t\u00ednh (c\u00e1c commit \u0111\u01b0\u1ee3c s\u1eafp x\u1ebfp theo m\u1ed9t chu\u1ed7i li\u00ean t\u1ee5c, kh\u00f4ng c\u00f3 c\u00e1c nh\u00e1nh xen k\u1ebd)<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">H\u1ee3p nh\u1ea5t commit: V\u1edbi t\u00f9y ch\u1ecdn <\/span><b>-i<\/b><span style=\"font-weight: 400;\">, git rebase gi\u00fap h\u1ee3p nh\u1ea5t nhi\u1ec1u commits th\u00e0nh m\u1ed9t commit ch\u00ednh, gi\u00fap gi\u1ea3m s\u1ed1 l\u01b0\u1ee3ng commit kh\u00f4ng c\u1ea7n thi\u1ebft<\/span><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-nh\u01b0\u1ee3c-di\u1ec3m\"><b>Nh\u01b0\u1ee3c \u0111i\u1ec3m<\/b><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 m\u1ea5t m\u1ed9t s\u1ed1 th\u00f4ng tin c\u1ea7n thi\u1ebft: Vi\u1ec7c t\u00e1i t\u1ea1o l\u1ea1i l\u1ecbch s\u1eed commit c\u1ee7a git rebase d\u1eabn \u0111\u1ebfn vi\u1ec7c c\u00e1c th\u00f4ng tin nh\u01b0 nh\u00e1nh ph\u00e1t tri\u1ec3n c\u1ee7a commit, th\u1eddi \u0111i\u1ec3m h\u1ee3p nh\u1ea5t c\u00e1c commit s\u1ebd r\u1ea5t kh\u00f3 \u0111\u1ec3 truy xu\u1ea5t.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">D\u1ec5 x\u1ea3y ra xung \u0111\u1ed9t: B\u1ea3n ch\u1ea5t c\u1ee7a git rebase l\u00e0 di chuy\u1ec3n ho\u1eb7c \u00e1p d\u1ee5ng l\u1ea1i c\u00e1c commit t\u1eeb m\u1ed9t nh\u00e1nh l\u00ean tr\u00ean c\u00e1c commit m\u1edbi h\u01a1n \u1edf nh\u00e1nh kh\u00e1c. Trong qu\u00e1 tr\u00ecnh n\u00e0y, n\u1ebfu c\u00f3 s\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa n\u1ed9i dung c\u1ee7a c\u00e1c commit \u0111\u01b0\u1ee3c \u00e1p d\u1ee5ng l\u1ea1i v\u00e0 nh\u1eefng commit \u0111\u00e3 t\u1ed3n t\u1ea1i, d\u1ec5 d\u1eabn \u0111\u1ebfn xung \u0111\u1ed9t.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Kh\u00f4ng ph\u1ea3n \u00e1nh \u0111\u00fang l\u1ecbch s\u1eed kho l\u01b0u tr\u1eef: V\u00ec git rebase thay \u0111\u1ed5i th\u1ee9 t\u1ef1 commit, l\u1ecbch s\u1eed kh\u00f4ng c\u00f2n ph\u1ea3n \u00e1nh ch\u00ednh x\u00e1c c\u00e1ch c\u00e1c thay \u0111\u1ed5i \u0111\u01b0\u1ee3c t\u00edch h\u1ee3p ban \u0111\u1ea7u<\/span><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-quy-trinh-th\u1ef1c-hi\u1ec7n-git-rebase\"><span class=\"ez-toc-section\" id=\"Quy_trinh_thuc_hien_Git_Rebase\"><\/span><b>Quy tr\u00ecnh th\u1ef1c hi\u1ec7n Git Rebase<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Gi\u1ea3 s\u1eed ch\u00fang ta \u0111ang c\u00f3 nh\u00e1nh main v\u00e0 nh\u00e1nh t\u00ednh n\u0103ng new-feature \u0111\u01b0\u1ee3c t\u00e1ch ra t\u1eeb nh\u00e1nh main. Sau qu\u00e1 tr\u00ecnh l\u00e0m vi\u1ec7c, nh\u00e1nh new-feature \u0111ang c\u00f3 m\u1ed9t s\u1ed1 commits m\u1edbi v\u00e0 c\u1ea7n \u0111\u01b0\u1ee3c \u0111\u1ea9y l\u00ean kho l\u01b0u tr\u1eef t\u1eeb xa \u0111\u1ec3 th\u1ef1c hi\u1ec7n t\u1ea1o pull request.<\/span><\/p>\n\n\n\n<p><strong>Tr\u01b0\u1edbc h\u1ebft c\u1ea7n th\u1ef1c hi\u1ec7n git rebase \u0111\u1ec3 c\u1eadp nh\u1eadt m\u00e3 ngu\u1ed3n m\u1edbi nh\u1ea5t t\u1eeb nh\u00e1nh main:<\/strong><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Checkout qua nh\u00e1nh c\u1ea7n \u0111\u01b0\u1ee3c rebase (\u1edf \u0111\u00e2y s\u1ebd l\u00e0 nh\u00e1nh main)<\/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;\">\u0110\u1ea3m b\u1ea3o nh\u00e1nh main \u0111\u00e3 \u1edf tr\u1ea1ng th\u00e1i m\u1edbi nh\u1ea5t<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git pull origin main<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Chuy\u1ec3n sang nh\u00e1nh t\u00ednh n\u0103ng v\u00e0 th\u1ef1c hi\u1ec7n rebase c\u00e1c thay \u0111\u1ed5i m\u1edbi t\u1eeb nh\u00e1nh main<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git checkout new-feature<\/span>\n\n<span style=\"font-weight: 400;\">git rebase main<\/span><\/code><\/pre>\n\n\n\n<p><strong>Tr\u01b0\u1eddng h\u1ee3p c\u00f3 xung \u0111\u1ed9t x\u1ea3y ra, th\u1ef1c hi\u1ec7n x\u1eed l\u00fd xung \u0111\u1ed9t:<\/strong><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">M\u1edf t\u1eadp tin b\u1ecb xung \u0111\u1ed9t, git s\u1ebd \u0111\u00e1nh d\u1ea5u ph\u1ea7n m\u00e3 b\u1ecb xung \u0111\u1ed9t nh\u01b0 sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">&lt;&lt;&lt;&lt;&lt;&lt;&lt;HEAD <\/span>\n<span style=\"font-weight: 400;\"># \u0110\u00e2y l\u00e0 thay \u0111\u1ed5i tr\u00ean nh\u00e1nh new-feature...<\/span>\n<span style=\"font-weight: 400;\">=======<\/span>\n<span style=\"font-weight: 400;\"># \u0110\u00e2y l\u00e0 thay \u0111\u1ed5i t\u1eeb nh\u00e1nh main ...<\/span>\n<span style=\"font-weight: 400;\">&gt;&gt;&gt;&gt;&gt;&gt;&gt;main<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Gi\u1eef l\u1ea1i ph\u1ea7n code ph\u00f9 h\u1ee3p ho\u1eb7c k\u1ebft h\u1ee3p c\u00e1c thay \u0111\u1ed5i c\u1ee7a c\u1ea3 hai nh\u00e1nh.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Th\u00eam c\u00e1c n\u1ed9i dung \u0111\u00e3 gi\u1ea3i quy\u1ebft v\u00e0o staging:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git add &lt;file&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">B\u1edfi v\u00ec git rebase s\u1ebd x\u1eed l\u00fd xung \u0111\u1ed9t tr\u00ean t\u1eebng commit, n\u00ean ch\u00fang ta c\u1ea7n ti\u1ebfp t\u1ee5c qu\u00e1 tr\u00ecnh rebase cho \u0111\u1ebfn khi k\u1ebft th\u00fac:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase --<\/span><span style=\"font-weight: 400;\">continue<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Tr\u01b0\u1eddng h\u1ee3p mu\u1ed1n ho\u00e0n t\u00e1c h\u00e0nh \u0111\u1ed9ng rebase, 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 rebase --abort<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">\u0110\u1ea9y n\u1ed9i dung nh\u00e1nh t\u00ednh n\u0103ng l\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 push origin new-feature<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd, n\u1ebfu nh\u00e1nh \u0111\u00e3 \u0111\u01b0\u1ee3c \u0111\u1ea9y l\u00ean kho l\u01b0u tr\u1eef t\u1eeb xa v\u00e0 c\u00f3 ng\u01b0\u1eddi kh\u00e1c \u0111ang l\u00e0m vi\u1ec7c, vi\u1ec7c thay \u0111\u1ed5i l\u1ecbch s\u1eed commit c\u00f3 th\u1ec3 g\u00e2y ra xung \u0111\u1ed9t v\u00e0 l\u1ed7i. V\u00ec v\u1eady kh\u00f4ng n\u00ean s\u1eed d\u1ee5ng git rebase trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-so-sanh-git-rebase-va-git-merge\"><span class=\"ez-toc-section\" id=\"So_sanh_Git_rebase_va_Git_merge\"><\/span><b> So s\u00e1nh Git rebase v\u00e0 Git merge<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase v\u00e0 Git merge \u0111\u1ec1u l\u00e0 nh\u1eefng ph\u01b0\u01a1ng ph\u00e1p \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 h\u1ee3p nh\u1ea5t c\u00e1c thay \u0111\u1ed5i t\u1eeb nh\u00e1nh n\u00e0y v\u00e0o nh\u00e1nh kh\u00e1c trong Git, nh\u01b0ng gi\u1eefa ch\u00fang c\u00f3 nh\u1eefng \u0111\u1eb7c \u0111i\u1ec3m kh\u00e1c nhau.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">D\u01b0\u1edbi \u0111\u00e2y l\u00e0 b\u1ea3ng so s\u00e1nh chi ti\u1ebft gi\u1eefa Git rebase v\u00e0 Git merge, gi\u00fap b\u1ea1n c\u00f3 th\u1ec3 l\u1ef1a ch\u1ecdn ph\u01b0\u01a1ng ph\u00e1p ph\u00f9 h\u1ee3p:<\/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 rebase<\/b><\/td><td><b>Git merge<\/b><\/td><\/tr><tr><td><b>C\u00fa ph\u00e1p<\/b><\/td><td><span style=\"font-weight: 400;\">git rebase &lt;t\u00ean nh\u00e1nh&gt;<\/span><\/td><td><span style=\"font-weight: 400;\">git merge &lt;t\u00ean nh\u00e1nh&gt;<\/span><\/td><\/tr><tr><td><b>T\u1ea1o ra merge commit<\/b><\/td><td><span style=\"font-weight: 400;\">Kh\u00f4ng<\/span><\/td><td><span style=\"font-weight: 400;\">C\u00f3 (tr\u01b0\u1eddng h\u1ee3p c\u1ea3 hai nh\u00e1nh \u0111\u1ec1u c\u00f3 thay \u0111\u1ed5i m\u1edbi)<\/span><\/td><\/tr><tr><td><b> L\u1ecbch s\u1eed commit<\/b><\/td><td><span style=\"font-weight: 400;\">T\u1ea1o ra l\u1ecbch s\u1eed tuy\u1ebfn t\u00ednh, kh\u00f4ng c\u00f3 r\u1ebd nh\u00e1nh hay merge commit<\/span><\/td><td><span style=\"font-weight: 400;\">L\u1ecbch s\u1eed kh\u00f4ng tuy\u1ebfn t\u00ednh, c\u00f3 c\u00e1c nh\u00e1nh r\u1ebd v\u00e0 merge commit, ph\u1ea3n \u00e1nh qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n th\u1ef1c t\u1ebf.<\/span><\/td><\/tr><tr><td><b>X\u1eed l\u00fd xung \u0111\u1ed9t<\/b><\/td><td><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 c\u1ea7n x\u1eed l\u00fd xung \u0111\u1ed9t nhi\u1ec1u l\u1ea7n \u0111\u1ed1i v\u1edbi t\u1eebng commit khi rebase<\/span><\/td><td><span style=\"font-weight: 400;\">X\u1eed l\u00fd xung \u0111\u1ed9t m\u1ed9t l\u1ea7n duy nh\u1ea5t trong qu\u00e1 tr\u00ecnh merge<\/span><\/td><\/tr><tr><td><b>Tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng<\/b><\/td><td><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u1ea7n gi\u1eef l\u1ecbch s\u1eed g\u1ecdn g\u00e0ng v\u00e0 tuy\u1ebfn t\u00ednh<\/span><\/li><br><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Khi l\u00e0m vi\u1ec7c tr\u00ean m\u1ed9t nh\u00e1nh c\u00e1 nh\u00e2n, tr\u01b0\u1edbc khi h\u1ee3p nh\u1ea5t v\u00e0o nh\u00e1nh ch\u00ednh<\/span><\/li><br><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Khi g\u1ed9p c\u00e1c thay \u0111\u1ed5i nh\u1ecf ho\u1eb7c commit kh\u00f4ng c\u1ea7n thi\u1ebft (squash)<\/span><\/li><\/ul><\/td><td><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Khi c\u1ea7n gi\u1eef nguy\u00ean l\u1ecbch s\u1eed ph\u00e1t tri\u1ec3n th\u1ef1c t\u1ebf<\/span><\/li><br><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Khi l\u00e0m vi\u1ec7c nh\u00f3m, c\u1ea7n gi\u1eef l\u1ecbch s\u1eed r\u00f5 r\u00e0ng v\u00e0 tr\u00e1nh xung \u0111\u1ed9t<\/span><\/li><\/ul><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-tuy-ch\u1ecdn-nang-cao-c\u1ee7a-git-rebase\"><span class=\"ez-toc-section\" id=\"Cac_tuy_chon_nang_cao_cua_git_rebase\"><\/span><b>C\u00e1c t\u00f9y ch\u1ecdn n\u00e2ng cao c\u1ee7a git rebase<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase cung c\u1ea5p nhi\u1ec1u t\u00f9y ch\u1ecdn n\u00e2ng cao \u0111\u1ec3 t\u00f9y ch\u1ec9nh c\u00e1ch th\u1ee9c ho\u1ea1t \u0111\u1ed9ng c\u0169ng nh\u01b0 tr\u01b0\u1eddng h\u1ee3p x\u1eed l\u00fd. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 m\u1ed9t s\u1ed1 t\u00f9y ch\u1ecdn ph\u1ed5 bi\u1ebfn:<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-interactive-t\u01b0\u01a1ng-tac-commit\"><b>&#8211;interactive (t\u01b0\u01a1ng t\u00e1c commit)<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">T\u00f9y ch\u1ecdn n\u00e0y cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng t\u01b0\u01a1ng t\u00e1c v\u1edbi t\u1eebng commit trong qu\u00e1 tr\u00ecnh rebase. C\u00fa ph\u00e1p chung nh\u01b0 sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase -i HEAD~&lt;n&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong \u0111\u00f3, n l\u00e0 s\u1ed1 commit c\u1ea7n ch\u1ec9nh s\u1eeda t\u1eeb \u0111\u1ea7u l\u1ecbch s\u1eed commit.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Khi ch\u1ea1y l\u1ec7nh n\u00e0y, c\u00e1c commit s\u1ebd l\u1ea7n l\u01b0\u1ee3t \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb trong ch\u1ebf \u0111\u1ed9 t\u01b0\u01a1ng t\u00e1c v\u1edbi c\u00e1c h\u00e0nh \u0111\u1ed9ng:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Pick: gi\u1eef nguy\u00ean commit<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Reword: ch\u1ec9nh s\u1eeda th\u00f4ng tin \u201ccommit message\u201d<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Edit: Ch\u1ec9nh s\u1eeda n\u1ed9i dung commit<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Squash: H\u1ee3p nh\u1ea5t commit hi\u1ec7n t\u1ea1i v\u1edbi commit tr\u01b0\u1edbc \u0111\u00f3<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Drop: x\u00f3a commit<\/span><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-autosquash\"><b>&#8211;autosquash<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">T\u00f9y ch\u1ecdn n\u00e0y \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng k\u1ebft h\u1ee3p v\u1edbi <code>--interactive<\/code>, gi\u00fap t\u1ef1 \u0111\u1ed9ng di chuy\u1ec3n c\u00e1c commit c\u00f3 th\u00f4ng \u0111i\u1ec7p b\u1eaft \u0111\u1ea7u b\u1eb1ng \u201cfixup!\u201d ho\u1eb7c \u201csquash!\u201d \u0111\u1ebfn \u0111\u00fang v\u1ecb tr\u00ed t\u01b0\u01a1ng \u1ee9ng c\u1ee7a ch\u00fang.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\"># t\u1ea1o commit fixup v\u00e0 squash<\/span>\n\n<span style=\"font-weight: 400;\">git commit --fixup=&lt;commit-hash&gt;<\/span>\n\n<span style=\"font-weight: 400;\">git commit --squash=&lt;commit-hash&gt;<\/span>\n\n<span style=\"font-weight: 400;\"># th\u1ef1c hi\u1ec7n autosquash<\/span>\n\n<span style=\"font-weight: 400;\">git rebase -i --autosquash HEAD~&lt;n&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, ch\u00fang ta c\u00f3 nh\u00e1nh A v\u1edbi c\u00e1c commit sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">hash_1&nbsp; <\/span><span style=\"font-weight: 400;\">\"Add feature login\"<\/span>\n<span style=\"font-weight: 400;\">hash_2&nbsp; <\/span><span style=\"font-weight: 400;\">\"Fix case login failed\"<\/span>\n<span style=\"font-weight: 400;\">hash_3&nbsp; <\/span><span style=\"font-weight: 400;\">\"Implement feature login\"<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">B\u00e2y gi\u1edd b\u1ea1n mu\u1ed1n g\u1ed9p commit hash_2 v\u00e0 hash_3 v\u00e0o commit hash_1, tuy nhi\u00ean mu\u1ed1n \u0111\u1ed5i t\u00ean commit g\u1ed9p th\u00e0nh t\u00ean c\u1ee7a commit hash_3. B\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n nh\u01b0 sau:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git commit --fixup=hash_2&nbsp; <\/span><span style=\"font-weight: 400;\"># Fix case login failed<\/span>\n<span style=\"font-weight: 400;\">git commit --squash=hash_3 <\/span><span style=\"font-weight: 400;\"># Implement feature login<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u1ecbch s\u1eed commit b\u00e2y gi\u1edd:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">hash_2&nbsp; <\/span><span style=\"font-weight: 400;\">\"fixup! Fix case login failed\"<\/span>\n<span style=\"font-weight: 400;\">hash_3&nbsp; <\/span><span style=\"font-weight: 400;\">\"squash! Implement feature login\"<\/span>\n<span style=\"font-weight: 400;\">hash_1 <\/span><span style=\"font-weight: 400;\">\"Add feature login\"<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Ch\u1ea1y rebase v\u1edbi &#8211;autosquash:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase -i --autosquash HEAD~3<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u00fac n\u00e0y:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Commit fixup t\u1ef1 \u0111\u1ed9ng h\u1ee3p nh\u1ea5t n\u1ed9i dung commit v\u00e0o hash_1 v\u00e0 lo\u1ea1i b\u1ecf th\u00f4ng \u0111i\u1ec7p.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Squash t\u1ef1 \u0111\u1ed9ng h\u1ee3p nh\u1ea5t n\u1ed9i dung commit v\u00e0o hash_1 v\u00e0 gi\u1eef l\u1ea1i th\u00f4ng \u0111i\u1ec7p \u0111\u1ec3 b\u1ea1n ch\u1ec9nh s\u1eeda.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Sau khi ch\u1ec9nh s\u1eeda th\u00f4ng \u0111i\u1ec7p (n\u1ebfu c\u1ea7n), l\u01b0u l\u1ea1i v\u00e0 tho\u00e1t.<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-weight: 400;\">L\u1ecbch s\u1eed sau khi rebase <code>--autosquash<\/code>:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">hash_1 <\/span><span style=\"font-weight: 400;\">\"Implement feature login (with fixes and improvements)\"<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-continue-abort-va-skip\"><b>&#8211;continue, &#8211;abort, v\u00e0 &#8211;skip<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Nh\u1eefng t\u00f9y ch\u1ecdn n\u00e0y gi\u00fap ki\u1ec3m so\u00e1t qu\u00e1 tr\u00ecnh rebase khi g\u1eb7p xung \u0111\u1ed9t (v\u00ed d\u1ee5 nh\u01b0 tr\u01b0\u1eddng h\u1ee3p \u1edf ph\u1ea7n 5). Trong \u0111\u00f3:<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-continue\"><b>&#8211;continue<\/b><\/h4>\n\n\n\n<p><span style=\"font-weight: 400;\">Ti\u1ebfp t\u1ee5c rebase sau khi gi\u1ea3i quy\u1ebft xung \u0111\u1ed9t trong commit<\/span>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase --<\/span><span style=\"font-weight: 400;\">continue<\/span><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-abort\"><b>&#8211;abort<\/b><\/h4>\n\n\n\n<p><span style=\"font-weight: 400;\">Ho\u00e0n t\u00e1c h\u00e0nh \u0111\u1ed9ng rebase v\u00e0 quay l\u1ea1i tr\u1ea1ng th\u00e1i tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase --abort<\/span><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-skip\"><b>&#8211;skip<\/b><\/h4>\n\n\n\n<p><span style=\"font-weight: 400;\">B\u1ecf qua commit hi\u1ec7n t\u1ea1i n\u1ebfu kh\u00f4ng mu\u1ed1n ti\u1ebfp t\u1ee5c v\u1edbi commit n\u00e0y.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase --skip<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-keep-empty\"><b>&#8211;keep-empty<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">M\u1eb7c \u0111\u1ecbnh, khi rebase s\u1ebd b\u1ecf qua c\u00e1c commit r\u1ed7ng (kh\u00f4ng c\u00f3 n\u1ed9i dung thay \u0111\u1ed5i), t\u00f9y ch\u1ecdn n\u00e0y gi\u00fap gi\u1eef l\u1ea1i c\u00e1c commit r\u1ed7ng \u0111\u00f3 trong qu\u00e1 tr\u00ecnh rebase:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase &lt;t\u00ean nh\u00e1nh&gt; --keep-empty<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-quiet\"><b>&#8211;quiet<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">T\u00f9y ch\u1ecdn <\/span><b><code>--quiet<\/code><\/b><span style=\"font-weight: 400;\"> gi\u00fap gi\u1ea3m b\u1edbt ho\u1eb7c t\u1eaft c\u00e1c th\u00f4ng b\u00e1o m\u00e0 Git hi\u1ec3n th\u1ecb. \u0110i\u1ec1u n\u00e0y h\u1eefu \u00edch khi b\u1ea1n mu\u1ed1n th\u1ef1c hi\u1ec7n c\u00e1c l\u1ec7nh m\u00e0 kh\u00f4ng c\u1ea7n th\u00f4ng tin chi ti\u1ebft ho\u1eb7c \u0111\u1ec3 t\u1ea1o script t\u1ef1 \u0111\u1ed9ng.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase &lt;t\u00ean nh\u00e1nh&gt; --quiet<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Git th\u1ef1c hi\u1ec7n rebase m\u00e0 kh\u00f4ng hi\u1ec3n th\u1ecb chi ti\u1ebft v\u1ec1 t\u1eebng commit ho\u1eb7c th\u00f4ng b\u00e1o th\u00f4ng th\u01b0\u1eddng. N\u1ebfu kh\u00f4ng c\u00f3 l\u1ed7i ho\u1eb7c xung \u0111\u1ed9t, b\u1ea1n s\u1ebd kh\u00f4ng th\u1ea5y b\u1ea5t k\u1ef3 \u0111\u1ea7u ra n\u00e0o trong terminal.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-verbose\"><b>&#8211;verbose<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Tr\u00e1i ng\u01b0\u1ee3c v\u1edbi <code>--quiet<\/code>, t\u00f9y ch\u1ecdn <code>--verbose<\/code> gi\u00fap hi\u1ec3n th\u1ecb th\u00eam th\u00f4ng tin chi ti\u1ebft v\u1ec1 qu\u00e1 tr\u00ecnh th\u1ef1c hi\u1ec7n l\u1ec7nh. \u0110i\u1ec1u n\u00e0y \u0111\u1eb7c bi\u1ec7t h\u1eefu \u00edch khi b\u1ea1n mu\u1ed1n hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 nh\u1eefng g\u00ec Git \u0111ang l\u00e0m.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase &lt;t\u00ean nh\u00e1nh&gt; --verbose<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-strategy\"><b>&#8211;strategy<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Theo m\u1eb7c \u0111\u1ecbnh, khi th\u1ef1c hi\u1ec7n git rebase, n\u1ebfu c\u00f3 xung \u0111\u1ed9t x\u1ea3y ra, b\u1ea1n s\u1ebd c\u1ea7n th\u1ef1c hi\u1ec7n x\u1eed l\u00fd xung \u0111\u1ed9t th\u1ee7 c\u00f4ng b\u1eb1ng vi\u1ec7c l\u1ef1a ch\u1ecdn ph\u1ea7n code \u0111\u01b0\u1ee3c gi\u1eef l\u1ea1i. Tuy nhi\u00ean b\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n t\u1ef1 \u0111\u1ed9ng nh\u1eefng c\u00f4ng vi\u1ec7c n\u00e0y b\u1eb1ng t\u00f9y ch\u1ecdn <\/span><b><code>--strategy<\/code><\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase --strategy=&lt;option&gt; &lt;t\u00ean nh\u00e1nh&gt;<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong \u0111\u00f3, ch\u00fang ta s\u1ebd c\u00f3 nh\u1eefng option sau:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><b>T\u00f9y ch\u1ecdn<\/b><\/td><td><b>\u00dd ngh\u0129a<\/b><\/td><td><b>Tr\u01b0\u1eddng h\u1ee3p s\u1eed d\u1ee5ng<\/b><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">recursive<\/span><\/td><td><span style=\"font-weight: 400;\">M\u1eb7c \u0111\u1ecbnh, h\u1ed7 tr\u1ee3 3-way (*) merge v\u00e0 x\u1eed l\u00fd t\u1ed1t c\u00e1c tr\u01b0\u1eddng h\u1ee3p ph\u1ee9c t\u1ea1p.<\/span><\/td><td><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng cho h\u1ea7u h\u1ebft c\u00e1c tr\u01b0\u1eddng h\u1ee3p.<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">resolve<\/span><\/td><td><span style=\"font-weight: 400;\">H\u1ee3p nh\u1ea5t 2-way (**) \u0111\u01a1n gi\u1ea3n, kh\u00f4ng h\u1ed7 tr\u1ee3 merge ph\u1ee9c t\u1ea1p.<\/span><\/td><td><span style=\"font-weight: 400;\">Khi xung \u0111\u1ed9t \u0111\u01a1n gi\u1ea3n ho\u1eb7c kh\u00f4ng ph\u1ee9c t\u1ea1p.<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">ours<\/span><\/td><td><span style=\"font-weight: 400;\">Gi\u1eef to\u00e0n b\u1ed9 thay \u0111\u1ed5i t\u1eeb nh\u00e1nh hi\u1ec7n t\u1ea1i (b\u1ecf qua thay \u0111\u1ed5i t\u1eeb nh\u00e1nh g\u1ed1c)<\/span><\/td><td><span style=\"font-weight: 400;\">Khi b\u1ea1n mu\u1ed1n \u01b0u ti\u00ean gi\u1eef thay \u0111\u1ed5i c\u1ee7a nh\u00e1nh hi\u1ec7n t\u1ea1i.<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400;\">theirs<\/span><\/td><td><span style=\"font-weight: 400;\">Gi\u1eef to\u00e0n b\u1ed9 thay \u0111\u1ed5i t\u1eeb nh\u00e1nh g\u1ed1c (b\u1ecf qua thay \u0111\u1ed5i t\u1eeb nh\u00e1nh hi\u1ec7n t\u1ea1i)<\/span><\/td><td><span style=\"font-weight: 400;\">Khi b\u1ea1n mu\u1ed1n \u01b0u ti\u00ean gi\u1eef thay \u0111\u1ed5i c\u1ee7a nh\u00e1nh g\u1ed1c.<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><i><span style=\"font-weight: 400;\">(*) 3-way merge: Th\u1ef1c hi\u1ec7n so s\u00e1nh s\u1ef1 kh\u00e1c nhau \u1edf c\u1ea3 hai phi\u00ean b\u1ea3n c\u1ee7a t\u1eadp tin v\u00e0 \u0111i\u1ec3m chung g\u1ed1c (common ancestor) c\u1ee7a 2 nh\u00e1nh<\/span><\/i><\/p>\n\n\n\n<p><i><span style=\"font-weight: 400;\">(**) 2-way merge: So s\u00e1nh tr\u1ef1c ti\u1ebfp gi\u1eefa hai phi\u00ean b\u1ea3n c\u1ee7a file (file t\u1eeb nh\u00e1nh hi\u1ec7n t\u1ea1i v\u00e0 file t\u1eeb nh\u00e1nh c\u1ea7n h\u1ee3p nh\u1ea5t), kh\u00f4ng s\u1eed d\u1ee5ng \u0111i\u1ec3m chung (common ancestor)<\/span><\/i><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-cau-h\u1ecfi-th\u01b0\u1eddng-g\u1eb7p-v\u1ec1-git-rebase\"><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_thuong_gap_ve_Git_rebase\"><\/span><b>C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Git rebase<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-khi-nao-nen-s\u1eed-d\u1ee5ng-git-rebase-thay-vi-git-merge\"><b>Khi n\u00e0o n\u00ean s\u1eed d\u1ee5ng git rebase thay v\u00ec git merge?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Vi\u1ec7c l\u1ef1a ch\u1ecdn git rebase hay l\u00e0 git merge s\u1ebd ph\u1ee5 thu\u1ed9c v\u00e0o nhu c\u1ea7u qu\u1ea3n l\u00fd l\u1ecbch s\u1eed commit c\u1ee7a d\u1ef1 \u00e1n. Ch\u00fang ta c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng git rebase thay v\u00ec git merge trong c\u00e1c tr\u01b0\u1eddng h\u1ee3p nh\u01b0:<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Khi mu\u1ed1n gi\u1eef l\u1ecbch s\u1eed commit g\u1ecdn g\u00e0ng v\u00e0 tuy\u1ebfn t\u00ednh<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Khi l\u00e0m vi\u1ec7c tr\u00ean nh\u00e1nh c\u00e1 nh\u00e2n v\u00e0 kh\u00f4ng mu\u1ed1n t\u1ea1o ra nhi\u1ec1u commit merge d\u01b0 th\u1eeba<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Khi mu\u1ed1n t\u00edch h\u1ee3p c\u00e1c thay \u0111\u1ed5i t\u1eeb nh\u00e1nh g\u1ed1c<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Khi c\u1ea7n g\u1ed9p (squash) c\u00e1c commit nh\u1ecf<\/span><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-lam-sao-d\u1ec3-hoan-tac-hanh-d\u1ed9ng-git-rebase\"><b>L\u00e0m sao \u0111\u1ec3 ho\u00e0n t\u00e1c h\u00e0nh \u0111\u1ed9ng git rebase?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong tr\u01b0\u1eddng h\u1ee3p qu\u00e1 tr\u00ecnh rebase v\u1eabn ch\u01b0a k\u1ebft th\u00fac do c\u00f3 xung \u0111\u1ed9t x\u1ea3y ra, n\u1ebfu b\u1ea1n mu\u1ed1n quay tr\u1edf l\u1ea1i tr\u1ea1ng th\u00e1i tr\u01b0\u1edbc khi rebase, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git rebase --abort<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Tuy nhi\u00ean, n\u1ebfu qu\u00e1 tr\u00ecnh rebase \u0111\u00e3 ho\u00e0n t\u1ea5t, l\u00fac n\u00e0y b\u1ea1n s\u1ebd ph\u1ea3i c\u1ea7n m\u1ed9t c\u00f4ng c\u1ee5 kh\u00e1c \u0111\u1ec3 th\u1ef1c hi\u1ec7n vi\u1ec7c quay tr\u1edf l\u1ea1i, \u0111\u00f3 ch\u00ednh l\u00e0 <\/span><b>git reflog<\/b><span style=\"font-weight: 400;\">. S\u1eed d\u1ee5ng git reflog \u0111\u1ec3 xem l\u1ea1i l\u1ecbch s\u1eed HEAD v\u00e0 t\u00ecm l\u1ea1i commit HEAD tr\u01b0\u1edbc th\u1eddi \u0111i\u1ec3m rebase.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git reflog<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 \u0111\u1ea7u ra:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">hash_1 (HEAD -&gt; feature) rebase finished: returning to refs\/heads\/feature<\/span>\n<span style=\"font-weight: 400;\">hash_2 HEAD@{1}: rebase (start): checkout main<\/span>\n<span style=\"font-weight: 400;\">hash_3 HEAD@{2}: commit: Add feature<\/span><\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Trong \u0111\u00f3, ta th\u1ea5y <code>HEAD@{2}<\/code> l\u00e0 tr\u1ea1ng th\u00e1i tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u rebase. L\u00fac n\u00e0y ta c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng git reset \u0111\u1ec3 quay tr\u1edf l\u1ea1i tr\u1ea1ng th\u00e1i ban \u0111\u1ea7u:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"font-weight: 400;\">git reset --hard HEAD@{2}<\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-git-rebase-co-lam-m\u1ea5t-d\u1eef-li\u1ec7u-khong\"><b>Git rebase c\u00f3 l\u00e0m m\u1ea5t d\u1eef li\u1ec7u kh\u00f4ng?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase kh\u00f4ng tr\u1ef1c ti\u1ebfp g\u00e2y ra t\u00ecnh tr\u1ea1ng m\u1ea5t d\u1eef li\u1ec7u n\u1ebfu ch\u00fang ta hi\u1ec3u \u0111\u00fang v\u1ec1 n\u00f3 v\u00e0 th\u1ef1c hi\u1ec7n \u0111\u00fang. Tuy nhi\u00ean, n\u1ebfu kh\u00f4ng c\u1ea9n th\u1eadn, d\u1eef li\u1ec7u c\u0169ng c\u00f3 th\u1ec3 b\u1ecb m\u1ea5t trong m\u1ed9t s\u1ed1 tr\u01b0\u1eddng h\u1ee3p nh\u01b0:<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Trong qu\u00e1 tr\u00ecnh rebase t\u01b0\u01a1ng t\u00e1c (interactive rebase), b\u1ea1n v\u00f4 t\u00ecnh ch\u1ecdn drop ho\u1eb7c x\u00f3a commit<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">X\u1eed l\u00fd xung \u0111\u1ed9t ch\u01b0a ch\u00ednh x\u00e1c, ch\u1ecdn nh\u1ea7m n\u1ed9i dung code \u0111\u00e3 l\u1ed7i th\u1eddi<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng <code>--skip<\/code> ch\u01b0a \u0111\u00fang, d\u1eabn \u0111\u1ebfn c\u00e1c xung \u0111\u1ed9t trong commit b\u1ecb b\u1ecf qua<\/span><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-k\u1ebft\"><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><b>T\u1ed5ng k\u1ebft<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Git rebase l\u00e0 l\u1ef1a ch\u1ecdn tuy\u1ec7t v\u1eddi khi b\u1ea1n mu\u1ed1n duy tr\u00ec l\u1ecbch s\u1eed commit s\u1ea1ch s\u1ebd, tuy\u1ebfn t\u00ednh&nbsp; v\u00e0 d\u1ec5 theo d\u00f5i, \u0111\u1eb7c bi\u1ec7t trong c\u00e1c d\u1ef1 \u00e1n c\u00f3 nh\u00e1nh ph\u00e1t tri\u1ec3n ri\u00eang bi\u1ec7t. Tuy nhi\u00ean, ch\u00fang ta c\u1ea7n ph\u1ea3i hi\u1ec3u r\u00f5 b\u1ea3n ch\u1ea5t c\u1ee7a n\u00f3 c\u0169ng nh\u01b0 c\u00e1ch s\u1eed d\u1ee5ng ph\u00f9 h\u1ee3p trong c\u00e1c t\u00ecnh hu\u1ed1ng th\u1ef1c t\u1ebf \u0111\u1ec3 tr\u00e1nh c\u00e1c r\u1ee7i ro kh\u00f4ng \u0111\u00e1ng c\u00f3 trong qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n ph\u1ea7n m\u1ec1m. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">ITviec hy v\u1ecdng b\u00e0i vi\u1ebft \u0111\u00e3 cung c\u1ea5p ki\u1ebfn th\u1ee9c h\u1eefu \u00edch gi\u00fap b\u1ea1n l\u00e0m vi\u1ec7c hi\u1ec7u qu\u1ea3 h\u01a1n v\u1edbi Git v\u00e0 Git rebase.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git l\u00e0 m\u1ed9t trong nh\u1eefng c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n ph\u1ed5 bi\u1ebfn. \u0110i\u1ec3m n\u1ed5i b\u1eadt c\u1ee7a Git n\u1eb1m \u1edf kh\u1ea3 n\u0103ng ph\u00e2n t\u00e1ch v\u00e0 h\u1ee3p nh\u1ea5t nh\u00e1nh, gi\u00fap n\u00e2ng cao hi\u1ec7u qu\u1ea3 trong qu\u00e1 tr\u00ecnh c\u1ed9ng t\u00e1c, l\u00e0m vi\u1ec7c nh\u00f3m. Git rebase ch\u00ednh l\u00e0 m\u1ed9t trong nh\u1eefng ph\u01b0\u01a1ng ph\u00e1p hi\u1ec7u qu\u1ea3 \u0111\u1ec3 th\u1ef1c hi\u1ec7n [&hellip;]<\/p>\n","protected":false},"author":235,"featured_media":83080,"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-82652","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 rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao - ITviec Blog<\/title>\n<meta name=\"description\" content=\"Trong Git, Git rebase ch\u00ednh l\u00e0 m\u1ed9t trong nh\u1eefng ph\u01b0\u01a1ng ph\u00e1p hi\u1ec7u qu\u1ea3 \u0111\u1ec3 th\u1ef1c hi\u1ec7n h\u1ee3p nh\u1ea5t thay \u0111\u1ed5i gi\u1eefa c\u00e1c nh\u00e1nh.\" \/>\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-rebase-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao\" \/>\n<meta property=\"og:description\" content=\"Git l\u00e0 m\u1ed9t trong nh\u1eefng c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n ph\u1ed5 bi\u1ebfn. \u0110i\u1ec3m n\u1ed5i b\u1eadt c\u1ee7a Git n\u1eb1m \u1edf kh\u1ea3 n\u0103ng ph\u00e2n t\u00e1ch v\u00e0 h\u1ee3p nh\u1ea5t nh\u00e1nh, gi\u00fap n\u00e2ng cao hi\u1ec7u qu\u1ea3 trong\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/git-rebase-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-12-19T04:30:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-10T03:46:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-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=\"16 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Git rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao - ITviec Blog","description":"Trong Git, Git rebase ch\u00ednh l\u00e0 m\u1ed9t trong nh\u1eefng ph\u01b0\u01a1ng ph\u00e1p hi\u1ec7u qu\u1ea3 \u0111\u1ec3 th\u1ef1c hi\u1ec7n h\u1ee3p nh\u1ea5t thay \u0111\u1ed5i gi\u1eefa c\u00e1c nh\u00e1nh.","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-rebase-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"Git rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao","og_description":"Git l\u00e0 m\u1ed9t trong nh\u1eefng c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n ph\u1ed5 bi\u1ebfn. \u0110i\u1ec3m n\u1ed5i b\u1eadt c\u1ee7a Git n\u1eb1m \u1edf kh\u1ea3 n\u0103ng ph\u00e2n t\u00e1ch v\u00e0 h\u1ee3p nh\u1ea5t nh\u00e1nh, gi\u00fap n\u00e2ng cao hi\u1ec7u qu\u1ea3 trong","og_url":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2024-12-19T04:30:37+00:00","article_modified_time":"2025-07-10T03:46:05+00:00","og_image":[{"width":1500,"height":790,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-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":"16 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/"},"author":{"name":"Ph\u1ea1m H\u1eefu Ng\u1ecdc","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/407769a7625b7f955cef615f7a99abad"},"headline":"Git rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao","datePublished":"2024-12-19T04:30:37+00:00","dateModified":"2025-07-10T03:46:05+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/"},"wordCount":3998,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-la-gi-vippro.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/","url":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/","name":"Git rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-la-gi-vippro.jpg","datePublished":"2024-12-19T04:30:37+00:00","dateModified":"2025-07-10T03:46:05+00:00","description":"Trong Git, Git rebase ch\u00ednh l\u00e0 m\u1ed9t trong nh\u1eefng ph\u01b0\u01a1ng ph\u00e1p hi\u1ec7u qu\u1ea3 \u0111\u1ec3 th\u1ef1c hi\u1ec7n h\u1ee3p nh\u1ea5t thay \u0111\u1ed5i gi\u1eefa c\u00e1c nh\u00e1nh.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/git-rebase-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-la-gi-vippro.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/12\/git-rebase-la-gi-vippro.jpg","width":1500,"height":790},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/git-rebase-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 rebase: H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao"}]},{"@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\/82652","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=82652"}],"version-history":[{"count":2,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/82652\/revisions"}],"predecessor-version":[{"id":89228,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/82652\/revisions\/89228"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/83080"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=82652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=82652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=82652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}