-
Notifications
You must be signed in to change notification settings - Fork 8
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
15 changed files
with
334 additions
and
266 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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
#=========================================================================== | ||
# Init git cli configuration | ||
#=========================================================================== | ||
|
||
#--- Colors and styles | ||
export YELLOW='\033[1;33m' | ||
export STD='\033[0m' | ||
export BOLD='\033[1m' | ||
export REVERSE='\033[7m' | ||
|
||
configureGit() { | ||
flag=$(echo "${GIT_OPTIONS}" | grep " $1 ") | ||
if [ "${flag}" = "" ] ; then | ||
printf "\n%b- Set \"$1\" propertie...%b" "${YELLOW}" "${STD}" | ||
git config --global $1 "$2" | ||
fi | ||
} | ||
|
||
#--- List options | ||
printf "\n%bSet git configuration%b\n" "${REVERSE}${YELLOW}" "${STD}" | ||
GIT_OPTIONS=$(git config --name-only -l | sed -e "s+^+ +g" | sed -e "s+$+ +g") | ||
|
||
#--- Config git options | ||
configureGit "user.name" "$(hostname)" | ||
configureGit "user.email" "$(hostname)@orange.com" | ||
|
||
configureGit "alias.co" "checkout" | ||
configureGit "alias.br" "branch" | ||
configureGit "alias.lol" "log --graph --decorate --pretty=oneline --abbrev-commit" | ||
configureGit "alias.lola" "log --graph --decorate --pretty=oneline --abbrev-commit --all" | ||
configureGit "alias.st" "status" | ||
configureGit "alias.uncommit" "reset --soft HEAD~1" | ||
|
||
configureGit "color.ui" "auto" | ||
|
||
configureGit "core.editor" "vi" | ||
configureGit "core.eol" "lf" | ||
configureGit "core.autocrlf" "input" | ||
configureGit "core.preloadindex" "true" | ||
|
||
configureGit "credential.helper" "cache --timeout=86400" | ||
|
||
configureGit "http.postbuffer" "524288000" | ||
|
||
configureGit "grep.linenumber" "true" | ||
|
||
configureGit "push.default" "tracking" | ||
|
||
#--- Display configurations | ||
printf "\n\n%bGit configuration%b\n" "${REVERSE}${YELLOW}" "${STD}" | ||
git config -l |
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
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
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
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
Oops, something went wrong.