Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some new aliases suggestions #55

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions gitalias.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@

### branch ###

# list branches along with their description
bv = !"f(){\
T=$(printf \\\t);\
git branch \"$@\" --format='%(refname:short) %(HEAD)%09%(objectname:short)%09%(contents:subject)'|\
while read -r l;do\
d=$(git config \"branch.${l%% *}.description\");\
echo \"$l${d:+$T($d)}\";\
done|\
column -ts\"$T\";\
};f"

romain-dartigues marked this conversation as resolved.
Show resolved Hide resolved
# branch and only list branches whose tips are reachable from the specified commit (HEAD if not specified).
bm = branch --merged

Expand Down Expand Up @@ -390,6 +401,9 @@
# This is a slightly modified version
fixup = "!f() { TARGET=$(git rev-parse \"$1\"); git commit --fixup=$TARGET && GIT_EDITOR=true git rebase --interactive --autosquash $TARGET~; }; f"

# Shorthand to stash/rebase/unstash
fix = !"f(){ git rebase --autostash -i \"${@:-HEAD^^}\";};f"

romain-dartigues marked this conversation as resolved.
Show resolved Hide resolved
### reflog ###

# reflog - reference log that manages when tips of branches are updated.
Expand Down Expand Up @@ -1089,6 +1103,9 @@
#
clone-lean = clone --depth 1 --filter=combine:blob:none+tree:0 --no-checkout

# Save the current branch (for example, prior a rebase)
backup-branch = !"git branch backup/$(date +%F/%H-%M-%S)"

# Stash snapshot - from http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
# Take a snapshot of your current working tree without removing changes.
# This is handy for refactoring where you can't quite fit what you've done
Expand Down