Last active
December 12, 2025 05:14
-
-
Save antonkomarev/7195a4b0cd63cf4e2515256050c7e895 to your computer and use it in GitHub Desktop.
Revisions
-
antonkomarev revised this gist
Dec 12, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Opens an interactive rebase for all commits in the current branch **that are not Useful for squashing or editing only your new commits. ```shell git rh ``` ## git ru -
antonkomarev revised this gist
Sep 4, 2025 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ [alias] go = "!git switch ${1:-master} && git pull && git cleanup" rh = "!git rebase -i HEAD~$(git count)" ru = "!git rebase -i master" pf = "!git push --force-with-lease" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Same command, but with another branch name to switch to: git go feature/custom-branch-name ``` ## git rh Opens an interactive rebase for all commits in the current branch **that are not yet in master**, automatically calculating the number of commits to rebase. Useful for squashing or editing only your new commits. -
antonkomarev revised this gist
Sep 4, 2025 . 2 changed files with 18 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ [alias] go = "!git switch ${1:-master} && git pull && git cleanup" sq = "!git rebase -i HEAD~$(git count)" ru = "!git rebase -i master" pf = "!git push --force-with-lease" # secondary tool functions This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,33 +1,41 @@ ## git go 1. Switches to a selected branch (`master` by default) 2. Pulls changes from the remote server 3. Deletes all local branches which were deleted remotely ```shell git go ``` Same command, but with another branch name to switch to: ```shell git go feature/custom-branch-name ``` ## git sq Opens an interactive rebase for all commits in the current branch **that are not yet in master**, automatically calculating the number of commits to rebase. Useful for squashing or editing only your new commits. ```shell git sq ``` ## git ru Opens an interactive rebase of the current branch **on top of master**, using master as the fixed base. All commits in the branch will be reordered relative to master. ```shell git ru ``` ## git pf Force push with `--force-with-lease` flag. ```shell git pf ``` -
antonkomarev revised this gist
Sep 4, 2025 . 2 changed files with 7 additions and 24 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,8 @@ [alias] go = "!git switch ${1:-master} && git pull && git cleanup" sq = "!git rebase -i HEAD~$(git count)" pf = "!git push --force-with-lease" # secondary tool functions cleanup = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D" count = "!git rev-list --count HEAD ^$(git merge-base HEAD master)" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,5 @@ Add 2 aliases to `~/.gitconfig` file. ## git go 1. switches to seleted branch (`master` by default) @@ -32,18 +24,10 @@ Opens an interactive rebase for all commits in the current branch that are not i git sq ``` ## git pf Force push with `--force-with-lease` flag. ```shell git pf ``` -
antonkomarev revised this gist
Sep 4, 2025 . 2 changed files with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,5 @@ count=$(git rev-list --count HEAD ^$(git merge-base HEAD master)); \ git rebase -i HEAD~$count; \ }; f" puf = "!git push --force-with-lease" count = "!git rev-list --count HEAD ^$(git merge-base HEAD master)" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,6 +32,14 @@ Opens an interactive rebase for all commits in the current branch that are not i git sq ``` ## git puf Force push with `--force-with-lease` flag. ```shell git puf ``` ## git count Calculates the number of commits that are not in master branch. -
antonkomarev revised this gist
Sep 4, 2025 . 2 changed files with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ [alias] cleanup = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D" go = "!git switch ${1:-master} && git pull && git cleanup" sq = "!f() { \ count=$(git rev-list --count HEAD ^$(git merge-base HEAD master)); \ git rebase -i HEAD~$count; \ }; f" count = "!git rev-list --count HEAD ^$(git merge-base HEAD master)" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,18 +24,18 @@ Same command, but with another branch name to switch to. git go feature/custom-branch-name ``` ## git sq Opens an interactive rebase for all commits in the current branch that are not in master branch. ```shell git sq ``` ## git count Calculates the number of commits that are not in master branch. ```shell git count ``` -
antonkomarev revised this gist
Sep 4, 2025 . 2 changed files with 25 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ [alias] cleanup = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D" go = "!git switch ${1:-master} && git pull && git cleanup" count = "!git rev-list --count HEAD ^$(git merge-base HEAD master)" sq = "!f() { \ count=$(git rev-list --count HEAD ^$(git merge-base HEAD @{upstream})); \ git rebase -i HEAD~$count; \ }; f" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,41 @@ Add 2 aliases to `~/.gitconfig` file. ## git cleanup 1. deletes all local branches which were deleted remotely. ```shell git cleanup ``` ## git go 1. switches to seleted branch (`master` by default) 2. pulling changes from remote server 3. deletes all local branches which were deleted remotely ```shell git go ``` Same command, but with another branch name to switch to. ```shell script git go feature/custom-branch-name ``` ## git count Calculates the number of commits that are not in master branch. ```shell git count ``` ## git sq Opens an interactive rebase for all commits in the current branch that are not in master branch. ```shell git sq ``` -
antonkomarev revised this gist
Sep 13, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ [alias] cleanup = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D" go = "!git switch ${1:-master} && git pull && git cleanup" -
antonkomarev revised this gist
Sep 13, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ [alias] cleanup = "!git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -D" go = "!git switch ${1:-master} && git pull && git cleanup" -
antonkomarev revised this gist
Sep 10, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,5 +21,5 @@ git go Same command, but with another branch name to switch to. ```shell script git go feature/custom-branch-name ``` -
antonkomarev revised this gist
Sep 10, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,8 @@ git cleanup git go ``` Same command, but with another branch name to switch to. ```shell script git go any-custom-branch-name ``` -
antonkomarev revised this gist
Sep 10, 2020 . No changes.There are no files selected for viewing
-
antonkomarev revised this gist
Sep 10, 2020 . No changes.There are no files selected for viewing
-
antonkomarev created this gist
Sep 10, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ [alias] cleanup = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D" go = "!git checkout ${1:-master} && git pull && git cleanup" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ Add 2 aliases to `~/.gitconfig` file. ## Git cleanup 1. deletes all local branches which were deleted remotely. ```shell script git cleanup ``` ## Git go 1. switches to seleted branch (`master` by default) 2. pulling changes from remote server 3. deletes all local branches which were deleted remotely ```shell script git go ``` ```shell script git go any-custom-branch-name ```