From 80352ea6664841cfff47118b8bd964a7aab630e0 Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 27 Nov 2020 18:53:44 +0100 Subject: [PATCH] zsh:1: command not found: q --- IT/git.md | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 IT/git.md diff --git a/IT/git.md b/IT/git.md deleted file mode 100644 index 407d07e..0000000 --- a/IT/git.md +++ /dev/null @@ -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 - -```