Skip to content

Instantly share code, notes, and snippets.

@fernandotakai
Created February 8, 2017 17:59
Show Gist options
  • Select an option

  • Save fernandotakai/f38cc0761c4f3df0edc8a4138df8eca9 to your computer and use it in GitHub Desktop.

Select an option

Save fernandotakai/f38cc0761c4f3df0edc8a4138df8eca9 to your computer and use it in GitHub Desktop.
function git-add(){
git add $(git status -s | egrep '^(\s|\?\?).*?$' | fzf -m | cut -c4-)
git commit -v
}
function git-remove(){
git reset HEAD -- $(git status -s | egrep -v '^(\s|\?\?).*?$' | fzf -m | cut -c4-)
}
function git-checkout(){
git checkout -- $(git status -s | egrep '^(\s|\?\?).*?$' | fzf -m | cut -c4-)
}
@fernandotakai
Copy link
Copy Markdown
Author

those are three simple functions that help be stage/remove/reset files using git. i feel like it's easier than typing whole paths, even with autocomplete.

usage: https://asciinema.org/a/djfmtdl34r4niqp6d0kd8zbgi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment