Skip to content

Instantly share code, notes, and snippets.

@anubhavsinha
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anubhavsinha/8aa57cbc9ea89cd792c1 to your computer and use it in GitHub Desktop.
Save anubhavsinha/8aa57cbc9ea89cd792c1 to your computer and use it in GitHub Desktop.
Adding an alias to save us from typing long git clone commands.
#########################################################
# Save this file to your /usr/local/bin (Ubuntu 14.04LTS)
# then run chmod 755 git_clone.sh
# add the following line to your .bash_aliases file.
# alias clone='/usr/local/bin/git_clone.sh'
# Now you can use it like
# as@xps:~/works$ clone awsma-server
# instead of typing the long version
# git clone git@github.com:anubhavsinha/awsma-server.git
# You should also add your ssh key to github.
# Don't forget to replace anubhavsinha with your username.
# Surely saves from some typing. Enjoy!
#########################################################
# Create the long git clone command string
prefix="git clone git@github.com:anubhavsinha/"
repository=$1
suffix=".git"
command=${prefix}${repository}${suffix}
# Now execute the string as a command
`$command`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment