diff --git a/repos/fb9e68c7ec482d136c77/Git magic.md b/repos/fb9e68c7ec482d136c77/Git magic.md new file mode 100644 index 0000000..463bb5a --- /dev/null +++ b/repos/fb9e68c7ec482d136c77/Git magic.md @@ -0,0 +1,19 @@ +#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 + +``` +git filter-branch --force --index-filter \ +'git rm --cached --ignore-unmatch \#web40.tex\#' \ +--prune-empty --tag-name-filter cat -- --all +``` + +## Change commit date + git commit --amend --date="Wed Feb 16 14:00 2011 +0100" \ No newline at end of file