mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 19:15:37 +00:00
fuzzy git reset
This commit is contained in:
parent
7970d36fa9
commit
59160eb247
@ -22,8 +22,8 @@ function gittools
|
|||||||
--height 50% \
|
--height 50% \
|
||||||
--preview 'git show --color=always (echo {} | cut -d" " -f4)' \
|
--preview 'git show --color=always (echo {} | cut -d" " -f4)' \
|
||||||
)
|
)
|
||||||
and set commit (echo $commitline | cut -d" " -f1)
|
and set commit (echo $commitline | cut -d" " -f4)
|
||||||
and git checkout $commit
|
and echo $commit
|
||||||
end
|
end
|
||||||
|
|
||||||
function git-checkout-fuzzy
|
function git-checkout-fuzzy
|
||||||
@ -87,6 +87,13 @@ function gittools
|
|||||||
echo "Not a fuzzy option."
|
echo "Not a fuzzy option."
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
case "reset"
|
||||||
|
set commit (git-commits)
|
||||||
|
and if test "$argv[2]" = "--hard"
|
||||||
|
git reset --hard $commit
|
||||||
|
else
|
||||||
|
git reset $commit
|
||||||
|
end
|
||||||
case "*"
|
case "*"
|
||||||
echo "No fuzzy option."
|
echo "No fuzzy option."
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user