diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-05-06 12:05:37 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-05-06 12:05:37 -0500 |
commit | b1632f9949dbe83004ad19b78fc618187068e570 (patch) | |
tree | b0370f08204b544c99ec9411eab4407eb28b3df6 | |
parent | 07f1ef6ea6ed37b7f1b7068c183e9192eb495ac9 (diff) |
feat(git): add alias for stashing the staged files (index)
-rw-r--r-- | git/.gitconfig | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/git/.gitconfig b/git/.gitconfig index 4a7db61..8d32a1c 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -30,9 +30,16 @@ cmd = code --wait --diff $LOCAL $REMOTE [trailer] separators = ":#" + [trailer "fix"] key = "Fix #" +[filter "lfs"] +clean = git-lfs clean -- %f +smudge = git-lfs smudge -- %f +process = git-lfs filter-process +required = true + [alias] # basic st = status -s @@ -71,17 +78,15 @@ brn = "!f() { git branch -m \"$(git rev-parse --abbrev-ref HEAD)\" $1; git fetch squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f" # grep on filename -f = "!git ls-files | grep -i" +ff = !git ls-files | grep -i # remove submodule smrm = "!f(){ git rm --cached \"$1\";rm -r \"$1\";git config -f .gitmodules --remove-section \"submodule.$1\";git config -f .git/config --remove-section \"submodule.$1\";git add .gitmodules; }; f" +# stash staged files +stashindex = !git stash --keep-index && git stash && git stash apply stash@{1} && git stash show -p | git apply -R && git stash drop stash@{1} + # generate git artifacts ignore = "!f() { IFS=\",\"; curl -L -s \"https://www.toptal.com/developers/gitignore/api/$*\" ;}; f" attributes = "!f() { curl -sL https://gist.githubusercontent.com/tobyvin/70f3671c76016063594ea45edbb97094/raw ;}; f" license = "!f() { curl -sH 'Accept: application/vnd.github.v3+json' https://api.github.com/licenses/$1 | grep -oP '.*\"body\":\\s*\"\\K.*(?=\\s*\",)' | tr '\\n' '\\0' | xargs -0 printf '%b\\n' | sed \"s/\\[year\\]/$(date +'%Y')/\" | sed \"s/\\[fullname\\]/$(git config --get user.name)/\"; }; f" -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true |