From 49a4d17a5dfdfc8fca6e62cb9564d24adec418c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Fri, 27 Feb 2015 08:55:03 -0800 Subject: [PATCH 1/4] --- gistfile1.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 gistfile1.sh diff --git a/gistfile1.sh b/gistfile1.sh new file mode 100644 index 0000000..a956039 --- /dev/null +++ b/gistfile1.sh @@ -0,0 +1,3 @@ +git clone +cd +git filter-branch --subdirectory-filter 'path/to/your/submodule' --prune-empty -- --all \ No newline at end of file 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 2/4] --- 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 From 4805cb0c9ec7c1371b941302a773b8a91a596824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Fri, 27 Feb 2015 10:12:15 -0800 Subject: [PATCH 3/4] --- Git magic.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Git magic.md b/Git magic.md index 2ef1957..10cfced 100644 --- a/Git magic.md +++ b/Git magic.md @@ -1,11 +1,13 @@ -# Create a submodule from a specific folder +#GIT MAGIC + +## 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 +## Remove a file from history ``` git filter-branch --force --index-filter \ From a31eb9b14ccf631ff56de7264d3461e66d075b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Sun, 22 Mar 2015 16:49:56 -0700 Subject: [PATCH 4/4] --- Git magic.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Git magic.md b/Git magic.md index 10cfced..463bb5a 100644 --- a/Git magic.md +++ b/Git magic.md @@ -13,4 +13,7 @@ git filter-branch --subdirectory-filter 'path/to/your/submodule' --prune-empty - 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 +``` + +## Change commit date + git commit --amend --date="Wed Feb 16 14:00 2011 +0100" \ No newline at end of file