Skip to content

Instantly share code, notes, and snippets.

@mmrko
mmrko / git-zsh-checkout-autocomplete-local-only.md
Last active Apr 16, 2021
List only local branches when autocompleting git checkout (Zsh)
View git-zsh-checkout-autocomplete-local-only.md
git config --global alias.checkoutr checkout
$EDITOR /usr/local/share/zsh/site-functions/git-completion.bash

...and then modify the file as follows...

-__gitcomp_nl "$(__git_refs '' $track)"
+if [ "$command" = "checkoutr" ]; then
+    __gitcomp_nl "$(__git_refs '' $track)"
+else
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')