2015-02-27 18:12:15 +00:00
|
|
|
#GIT MAGIC
|
|
|
|
|
|
|
|
## Create a submodule from a specific folder
|
2015-02-27 18:11:44 +00:00
|
|
|
```
|
|
|
|
git clone <your_project> <your_submodule>
|
|
|
|
cd <your_submodule>
|
|
|
|
git filter-branch --subdirectory-filter 'path/to/your/submodule' --prune-empty -- --all
|
|
|
|
```
|
|
|
|
|
2015-02-27 18:12:15 +00:00
|
|
|
## Remove a file from history
|
2015-02-27 18:11:44 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
git filter-branch --force --index-filter \
|
|
|
|
'git rm --cached --ignore-unmatch \#web40.tex\#' \
|
|
|
|
--prune-empty --tag-name-filter cat -- --all
|
2015-03-22 23:49:56 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Change commit date
|
|
|
|
git commit --amend --date="Wed Feb 16 14:00 2011 +0100"
|