Skip to content

Instantly share code, notes, and snippets.

@fharper
Created December 17, 2018 20:29
Show Gist options
  • Save fharper/d80d8d12efd1ebb5160e63bb15bcf50e to your computer and use it in GitHub Desktop.
Save fharper/d80d8d12efd1ebb5160e63bb15bcf50e to your computer and use it in GitHub Desktop.
CD into newly cloned folder automatically #lazyfred
git()
{
if [ "$1" = clone ] ; then
/usr/bin/git "$@" && cd $(basename $_ .git)
echo 'Changing directory to repo folder...'
else
/usr/bin/git "$@"
fi
}
@fharper
Copy link
Author

fharper commented Dec 17, 2018

Won't work on commands like git clone https://github.com/XXX/XXX.git ~/x, but I didn't have time to fix

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