From ae643d011ce770d99cf0bde235bab620ac439bab Mon Sep 17 00:00:00 2001 From: Nguyen Tran Hau Date: Fri, 10 Jul 2020 11:18:24 +0700 Subject: [PATCH] git gc --- src/Applications/Essential/git.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Applications/Essential/git.md b/src/Applications/Essential/git.md index 753c7cb..0301fbe 100644 --- a/src/Applications/Essential/git.md +++ b/src/Applications/Essential/git.md @@ -56,3 +56,17 @@ Rewrite history by changing last `x` commits : ```sh git rebase -i HEAD~x ``` + +Squash last `x` commits to 1 commit: + +```sh +git reset HEAD~x +git add -A +git commit +``` + +Cleanup unnecessary files: + +```sh +git gc +```