Sfoglia il codice sorgente

add git functions

pull/1/head
10sr 13 anni fa
parent
commit
96907fd95e
1 ha cambiato i file con 40 aggiunte e 0 eliminazioni
  1. +40
    -0
      .bashrc

+ 40
- 0
.bashrc Vedi File

@@ -71,6 +71,46 @@ alias pcalc="python -i -c 'from math import *' "
# alias diff="$(type colordiff >/dev/null 2>&1 && test $TERM != dumb && echo color)diff -u"
# type trash >/dev/null 2>&1 && alias rm=trash

export __MYGITBAREREP="${HOME}/dbx/.git-bare"
git-make-bare-rep(){
test $# -eq 0 && {
echo "specify repository name." 1>&2
return 1
}

dir="${__MYGITBAREREP}/$1.git"

if test -d "$dir"
then
echo "dir $dir already exist!" 1>&2
else
mkdir -p "$dir" &&
pushd "$dir" &&
git init --bare
popd
fi
}

git-add-bare-rep(){
test $# -ne 2 && {
echo "specify repository name and shortname." 1>&2
return 1
}

dir="${__MYGITBAREREP}/$2.git"
git-make-bare-rep $2 &&
git remote add $1 "$dir"
git remote -v

# if test -d "$dir"
# then
# git remote add $1 "$dir"
# git remote -v
# else
# echo "dir $dir does not exist!" 1>&2
# fi
}

bak(){
for file in "$@"
do


Caricamento…
Annulla
Salva