Last active
August 29, 2015 14:04
-
-
Save anubhavsinha/8aa57cbc9ea89cd792c1 to your computer and use it in GitHub Desktop.
Adding an alias to save us from typing long git clone commands.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################### | |
# 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