zsh:1: command not found: q
This commit is contained in:
parent
d468dd1812
commit
80352ea666
40
IT/git.md
40
IT/git.md
@ -1,40 +0,0 @@
|
||||
# git
|
||||
|
||||
## delete a file only from git repository
|
||||
|
||||
`git rm -rf --cached`
|
||||
|
||||
## delete a file from complete history
|
||||
|
||||
be carefull can't push repo last time use
|
||||
|
||||
`git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch logbook.md" HEAD`
|
||||
|
||||
## example de déclencheur git
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
GIT_REPO=`pwd`
|
||||
SITE_NAME=notebook
|
||||
TMP_GIT_CLONE="/tmp/$SITE_NAME"
|
||||
PUBLIC_WWW="/usr/share/nginx/html/$SITE_NAME"
|
||||
# get branch name
|
||||
if ! [ -t 0 ]; then
|
||||
read -a ref
|
||||
fi
|
||||
IFS='/' read -ra REF <<< "${ref[2]}"
|
||||
branch="${REF[2]}"
|
||||
|
||||
if [ "master" == "$branch" ]; then
|
||||
mkdir -p $TMP_GIT_CLONE
|
||||
echo "download repo"
|
||||
git clone --recursive $GIT_REPO $TMP_GIT_CLONE
|
||||
cd $TMP_GIT_CLONE
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
make install -e BUILDDIR=$PUBLIC_WWW
|
||||
echo "Cleaning up"
|
||||
rm -Rf $TMP_GIT_CLONE
|
||||
fi
|
||||
exit
|
||||
|
||||
```
|
Loading…
Reference in New Issue
Block a user