Skip to content
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
4 changes: 2 additions & 2 deletions git/.gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
lg = log --graph --all --pretty=format:'%C(yellow)%h %ad %C(green)%an%C(auto)%d %Creset%s' --date=short --decorate
ls = lg
ph = push origin HEAD
pl = pull origin HEAD
st = status
amend = commit --amend -C HEAD
undo = reset HEAD~1 --mixed
Expand Down Expand Up @@ -67,7 +68,6 @@
ra = !git amend --reset-author -n
pushall = !git remote | xargs -n1 git push
pushalltags = !git remote | xargs -n1 git push --tags
deletebranches = !git branch --merged | grep -v \\* | xargs git branch -D
delbranches = "!git branch --merged | grep -v \\* | xargs git branch -D"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding quotes around the command ensures that it is treated as a single command, which is generally a good practice, especially when dealing with pipes and xargs. However, verify that this change doesn't introduce any unexpected behavior, especially with the way arguments are passed to git branch -D.

Consider testing this command with different branch names, including those with spaces or special characters, to ensure it functions correctly.

  delbranches = "!git branch --merged | grep -v '\*' | xargs git branch -D"

prune = !git remote prune origin
cleanup = "!f() { git branch | grep -v \" $(git rev-parse --abbrev-ref HEAD)\" | xargs git branch -D; git fetch --prune;}; f"