From 8aa49ff90a26fe96a4b3eae982fb8f1230956e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Fri, 27 Feb 2015 10:11:44 -0800 Subject: [PATCH] --- Git magic.md | 14 ++++++++++++++ gistfile1.sh | 3 --- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 Git magic.md delete mode 100644 gistfile1.sh diff --git a/Git magic.md b/Git magic.md new file mode 100644 index 0000000..2ef1957 --- /dev/null +++ b/Git magic.md @@ -0,0 +1,14 @@ +# Create a submodule from a specific folder +``` +git clone +cd +git filter-branch --subdirectory-filter 'path/to/your/submodule' --prune-empty -- --all +``` + +# Remove a file from history + +``` +git filter-branch --force --index-filter \ +'git rm --cached --ignore-unmatch \#web40.tex\#' \ +--prune-empty --tag-name-filter cat -- --all +``` \ No newline at end of file diff --git a/gistfile1.sh b/gistfile1.sh deleted file mode 100644 index a956039..0000000 --- a/gistfile1.sh +++ /dev/null @@ -1,3 +0,0 @@ -git clone -cd -git filter-branch --subdirectory-filter 'path/to/your/submodule' --prune-empty -- --all \ No newline at end of file