1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-24 02:12:29 +00:00
gists/repos/fb9e68c7ec482d136c77/Git magic.md

19 lines
476 B
Markdown
Raw Normal View History

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"