Compare commits

...

4 Commits

Author SHA1 Message Date
Mohit Mayank f490d5fd26
Merge 2889838f44 into 6e9cda3d30 2025-01-22 12:17:35 +01:00
dependabot[bot] 6e9cda3d30
chore(deps): bump semver in /.github/workflows/dependencies (#12924)
Bumps [semver](https://github.com/python-semver/python-semver) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/python-semver/python-semver/releases)
- [Changelog](https://github.com/python-semver/python-semver/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/python-semver/python-semver/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-19 23:30:40 +01:00
Mohit Mayank 2889838f44
Add `gac` function description to README 2025-01-12 00:14:50 -06:00
Mohit Mayank f8c09ca13a
feat(git): add `gac` alias for staging and committing untracked files
The new `gac` function adds a convenient alias for staging and committing an untracked file in a single command.

Example Usage:
- `gac file.txt "Add initial version"`
  This stages `myfile.txt` and commits it with the message "Add initial version."
2025-01-12 00:12:31 -06:00
3 changed files with 18 additions and 1 deletions

View File

@ -3,5 +3,5 @@ charset-normalizer==3.4.1
idna==3.10 idna==3.10
PyYAML==6.0.2 PyYAML==6.0.2
requests==2.32.3 requests==2.32.3
semver==3.0.2 semver==3.0.3
urllib3==2.3.0 urllib3==2.3.0

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'