1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-24 18:32:27 +00:00
gists/Useful commands for git/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"