From 7a44756d8565f07466fb43a359f87a6c18dcc380 Mon Sep 17 00:00:00 2001 From: Yu Liang Date: Wed, 27 Nov 2024 15:25:10 -0500 Subject: [PATCH] (feat) Updated the git command blog. --- content/post/Useful_Git_Commands.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/content/post/Useful_Git_Commands.md b/content/post/Useful_Git_Commands.md index 433b15f..f389b1f 100755 --- a/content/post/Useful_Git_Commands.md +++ b/content/post/Useful_Git_Commands.md @@ -93,4 +93,14 @@ It is OK to repeatedly merge other branches to one branch. For example, we can r `git clone --filter=blob:none`: Download the git commit tree and the latest blob, but skipped the history blob at the time. Git will fetch for blob if you ask for history commit data. -If you are working with super large monorepo, you can use `scalar` command, an alternative `git` command that wraps up some `git` commands optimized for large repos. \ No newline at end of file +If you are working with super large monorepo, you can use `scalar` command, an alternative `git` command that wraps up some `git` commands optimized for large repos. + +If you have a series of commits, and you want to patch something up in the early commit, you can use: + +```bash +git commit -a --fixup= +# here, it will create a new patch commit on top of the head. +git rebase --autosquash main +# apply the patch commit to the old commit, and then rebase the commit series. +# it runs rebase in the background, if it encounters something that cannot fix, that it will prompt you for rebasing. +``` \ No newline at end of file