diff options
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/.DS_Store | bin | 0 -> 6148 bytes | |||
| -rwxr-xr-x | bin/git-amend | 4 | ||||
| -rwxr-xr-x | bin/git-bdiff | 11 | ||||
| -rwxr-xr-x | bin/git-blog | 11 | ||||
| -rwxr-xr-x | bin/git-fall | 5 | ||||
| -rwxr-xr-x | bin/git-fixup | 13 | ||||
| -rwxr-xr-x | bin/git-lol | 4 | ||||
| -rwxr-xr-x | bin/git-publish | 10 | ||||
| -rwxr-xr-x | bin/git-rewrite | 8 | ||||
| -rwxr-xr-x | bin/git-squash | 14 | ||||
| -rwxr-xr-x | bin/git-start | 13 | ||||
| -rwxr-xr-x | bin/git-this | 5 |
12 files changed, 75 insertions, 23 deletions
diff --git a/bin/.DS_Store b/bin/.DS_Store Binary files differnew file mode 100644 index 0000000..5008ddf --- /dev/null +++ b/bin/.DS_Store diff --git a/bin/git-amend b/bin/git-amend new file mode 100755 index 0000000..04430a6 --- /dev/null +++ b/bin/git-amend @@ -0,0 +1,4 @@ +#!/bin/bash -e + +# Replace the most recent commit: `git amend [commit options]`. +exec git commit --amend --no-edit "$@" diff --git a/bin/git-bdiff b/bin/git-bdiff new file mode 100755 index 0000000..eb93d13 --- /dev/null +++ b/bin/git-bdiff @@ -0,0 +1,11 @@ +#!/bin/bash -e + +# Diff for a branch, starting from where it diverges from its upstream. + +BRANCH=HEAD +if [ $# -gt 0 ]; then + BRANCH="$1" + shift +fi + +exec git diff "${BRANCH}@{upstream}" "${BRANCH}" "$@" diff --git a/bin/git-blog b/bin/git-blog new file mode 100755 index 0000000..8be71e7 --- /dev/null +++ b/bin/git-blog @@ -0,0 +1,11 @@ +#!/bin/bash -e + +# Log for a branch, starting from where it diverges from its upstream. + +BRANCH=HEAD +if [ $# -gt 0 ]; then + BRANCH="$1" + shift +fi + +exec git log "${BRANCH}@{upstream}...${BRANCH}" "$@" diff --git a/bin/git-fall b/bin/git-fall new file mode 100755 index 0000000..03b31de --- /dev/null +++ b/bin/git-fall @@ -0,0 +1,5 @@ +#!/bin/bash -e + +# Alias for `git remote update`. + +exec git remote update "$@" diff --git a/bin/git-fixup b/bin/git-fixup new file mode 100755 index 0000000..8910b2a --- /dev/null +++ b/bin/git-fixup @@ -0,0 +1,13 @@ +#!/bin/bash -e + +# Retrofit changes onto an old commit during the next rebase/rewrite: +# `git fixup [COMMITISH]` (for example, `git fixup HEAD`). + +COMMIT=HEAD +if [ $# -gt 0 ]; then + COMMIT="$1" + shift +fi + + +exec git commit --fixup "${COMMIT}" "$@" diff --git a/bin/git-lol b/bin/git-lol new file mode 100755 index 0000000..1476889 --- /dev/null +++ b/bin/git-lol @@ -0,0 +1,4 @@ +#!/bin/bash -e + +# Simple text-based commit graph: `git lol [BRANCHES|--all]` +exec git log --graph --oneline --decorate "$@" diff --git a/bin/git-publish b/bin/git-publish deleted file mode 100755 index 0016764..0000000 --- a/bin/git-publish +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -e - -# Copy your current branch to a "publishing" remote. -# -# By default, this remote is origin. However, you can set `publish.remote` to -# publish to another repository (eg. my-fork). - -REMOTE="$(git config publish.remote || echo "origin")" - -exec git push --force-with-lease "$@" "${REMOTE}" HEAD diff --git a/bin/git-rewrite b/bin/git-rewrite new file mode 100755 index 0000000..52bcaf9 --- /dev/null +++ b/bin/git-rewrite @@ -0,0 +1,8 @@ +#!/bin/bash -e + +# Rewrite the current branch, in place: `git rewrite` - unlike `git +# rebase`, this does _not_ advance the branch onto new upstream +# changes. You can use this to clean up branch history without +# worrying about conflicts with others' changes at the same time. + +exec git rebase --interactive --onto HEAD...@{upstream} diff --git a/bin/git-squash b/bin/git-squash new file mode 100755 index 0000000..26c363c --- /dev/null +++ b/bin/git-squash @@ -0,0 +1,14 @@ +#!/bin/bash -e + +# Retrofit changes onto an old commit during the next rebase/rewrite, +# adding an additional comment `git squash COMMITISH` (for example, +# `git squash HEAD`). + +COMMIT=HEAD +if [ $# -gt 0 ]; then + COMMIT="$1" + shift +fi + + +exec git commit --squash "${COMMIT}" "$@" diff --git a/bin/git-start b/bin/git-start deleted file mode 100755 index 8251fa4..0000000 --- a/bin/git-start +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e - -# Create a branch: `git start BRANCHNAME` (protip: run `git fall` first.) The -# new branch will track origin/main by default, or origin/master if origin/main -# doesn't exist. Tracking info gets used below. - -if git rev-parse --quiet --verify origin/main > /dev/null; then - exec git checkout --track origin/main -b "$@" -elif git rev-parse --quiet --verify origin/master > /dev/null; then - exec git checkout --track origin/master -b "$@" -fi - -exec git checkout --track origin/main -b "$@" diff --git a/bin/git-this b/bin/git-this new file mode 100755 index 0000000..913a37d --- /dev/null +++ b/bin/git-this @@ -0,0 +1,5 @@ +#!/bin/bash -e + +# Stage the work tree verbatim + +exec git add --all :/ |
