- rename git func as alias
This commit is contained in:
parent
7e8d2e01bb
commit
435b718c1a
35
func/git.sh
35
func/git.sh
|
|
@ -1,4 +1,4 @@
|
|||
get-branch(){
|
||||
getbranch(){
|
||||
local branch
|
||||
|
||||
# Récupère le nom de la branche actuelle
|
||||
|
|
@ -11,30 +11,31 @@ get-branch(){
|
|||
echo $branch
|
||||
}
|
||||
|
||||
git-reset(){
|
||||
gitreset(){
|
||||
local branch
|
||||
branch=get-branch
|
||||
|
||||
git fetch origin
|
||||
git reset --hard origin/"${1:$branch}"
|
||||
git reset --hard origin/"${1:-$branch}"
|
||||
git clean -fd
|
||||
|
||||
echo -e "${COLOR_GREEN}✅ Dépôt synchronisé et nettoyé.${NONE}"
|
||||
msg_success "Dépôt synchronisé et nettoyé."
|
||||
}
|
||||
|
||||
git-sync(){
|
||||
gitsync(){
|
||||
local branch
|
||||
branch=get-branch
|
||||
|
||||
git fetch
|
||||
git pull origin "${1:$branch}"
|
||||
git pull origin "${1:-$branch}"
|
||||
}
|
||||
|
||||
git-clone(){
|
||||
gitclone(){
|
||||
|
||||
[[ -z "$1" ]] && echo "Veuillez préciser l'adresse d'un dépôt Git" && return 1
|
||||
|
||||
# git config --global http.sslVerify false
|
||||
if [[ -z "$1" ]]; then
|
||||
msg_warning "Veuillez préciser l'adresse d'un dépôt Git"
|
||||
return 1
|
||||
fi
|
||||
|
||||
git init
|
||||
git remote add origin "$1"
|
||||
|
|
@ -42,17 +43,21 @@ git-clone(){
|
|||
git reset --hard origin/main
|
||||
git clean -fd
|
||||
|
||||
echo -e "${COLOR_GREEN}✅ Dépôt cloné.${NONE}"
|
||||
msg_success "Dépôt cloné."
|
||||
}
|
||||
|
||||
git-set-url(){
|
||||
giturl(){
|
||||
local branch
|
||||
branch=get-branch
|
||||
|
||||
git remote set-url origin "$1"
|
||||
|
||||
msg_success "Url du dépôt changé en $1."
|
||||
}
|
||||
|
||||
git-ssl() {
|
||||
local choice="${1:-true}"
|
||||
git config --global http.sslVerify "$choice"
|
||||
gitssl() {
|
||||
local choice="${1:-true}"
|
||||
git config --global http.sslVerify "$choice"
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue