-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,20 +22,27 @@ git config --global user.email "$EMAIL" | |
echo "Configuring global aliases..." | ||
git config --global alias.ci commit | ||
git config --global alias.st status | ||
git config --global alias.br branch | ||
git config --global alias.co checkout | ||
git config --global alias.last 'log -1 HEAD' | ||
git config --global alias.sub "submodule update --remote --merge" | ||
git config --global core.editor "vim" | ||
git config --global credential.helper 'cache --timeout=36000' | ||
|
||
read -r -p "Do you want to add ssh credentials for git? [y/n] " RESP | ||
RESP=${RESP,,} # tolower (only works with /bin/bash) | ||
if [[ $RESP =~ ^(yes|y)$ ]] | ||
|
||
CHECK_KEY_ED_EXISTS="$HOME/.ssh/id_ed25519.pub" | ||
if [[ $RESP =~ ^(yes|y)$ ]] && ! test -f "$CHECK_KEY_ED_EXISTS" | ||
then | ||
echo "Configuring git ssh access..." | ||
ssh-keygen -t ed25519 -C "$EMAIL" | ||
echo "This is your public key. To activate it in github, got to settings, SHH and GPG keys, New SSH key, and enter the following key:" | ||
cat ~/.ssh/id_ed25519.pub | ||
echo "" | ||
echo "To work with the ssh key, you have to clone all your repos with ssh instead of https. For example, for this repo you will have to use the url: [email protected]:miguelgfierro/scripts.git" | ||
echo -e "\nTo work with the ssh key, you have to clone all your repos with ssh instead of https. For example, for this repo you will have to use the url: [email protected]:miguelgfierro/scripts.git" | ||
else | ||
echo "You have already ssh-key. To activate it in github, got to settings, SHH and GPG keys, New SSH key, and enter the following key:" | ||
cat ~/.ssh/id_ed25519.pub | ||
fi | ||
|
||
if [ "$(uname)" == "Darwin" ]; then # Mac OS X platform | ||
|