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