This commit is contained in:
Mohit Mayank 2025-01-22 12:17:35 +01:00 committed by GitHub
commit f490d5fd26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -265,6 +265,7 @@ receive further support.
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. | | `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. |
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. | | `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. |
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. | | `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. |
| `gac` | Stages and commits an untracked file. |
| `gbda` | Deletes all merged branches | | `gbda` | Deletes all merged branches |
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) | | `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |

View File

@ -115,6 +115,22 @@ alias gamscp='git am --show-current-patch'
alias gams='git am --skip' alias gams='git am --skip'
alias gap='git apply' alias gap='git apply'
alias gapt='git apply --3way' alias gapt='git apply --3way'
# Adds and commits an untracked file.
function gac() {
if [ $# -lt 2 ]; then
echo "Usage: gac <file> <commit message>"
return 1
fi
local file="$1"
shift
local message="$@"
git add "$file"
git commit -m "$message"
}
alias gbs='git bisect' alias gbs='git bisect'
alias gbsb='git bisect bad' alias gbsb='git bisect bad'
alias gbsg='git bisect good' alias gbsg='git bisect good'