Adds git helper functions
This commit is contained in:
parent
51e194662e
commit
69005f87e6
1 changed files with 15 additions and 0 deletions
|
@ -4,6 +4,21 @@ function wgbranch {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# git status "plumbing" version
|
||||||
|
# Useful for piping into grep -> xargs git add
|
||||||
|
function wgst {
|
||||||
|
git status -s | awk '{ print $2 }'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# git add by file regex pattern
|
||||||
|
function wgadd {
|
||||||
|
pattern="$2"
|
||||||
|
|
||||||
|
wgst | grep "${pattern}" | xargs git add
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# compare file with another branch
|
# compare file with another branch
|
||||||
function wgcompare_file {
|
function wgcompare_file {
|
||||||
file_path="$1"
|
file_path="$1"
|
||||||
|
|
Loading…
Reference in a new issue