mirror of
https://github.com/sahinakkaya/til.git
synced 2024-12-22 07:09:39 +01:00
TIL: Pretend to be Linus
This commit is contained in:
parent
3aa7b9817e
commit
27a7d85d04
22
git/changing-the-author-and-committer-of-older-commits.md
Normal file
22
git/changing-the-author-and-committer-of-older-commits.md
Normal file
@ -0,0 +1,22 @@
|
||||
You can change author of your commits to anyone. Let's make all the commit's of the current repository Torvalds :D Luckily we know his email address so this will be very easy. Just run:
|
||||
```
|
||||
git filter-branch --env-filter '
|
||||
OLD_EMAIL="akkayas17@itu.edu.tr"
|
||||
CORRECT_NAME="Linus Torvals"
|
||||
CORRECT_EMAIL="torvalds@linux-foundation.org"
|
||||
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
|
||||
then
|
||||
export GIT_COMMITTER_NAME="$CORRECT_NAME"
|
||||
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
|
||||
fi
|
||||
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
|
||||
then
|
||||
export GIT_AUTHOR_NAME="$CORRECT_NAME"
|
||||
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
|
||||
fi
|
||||
' --tag-name-filter cat -- --branches --tags
|
||||
```
|
||||
|
||||
and we are done! :D
|
||||
|
||||
![Linus Torvalds is here](https://raw.github.com/Asocia/til/master/img/linus.jpg)
|
BIN
img/linus.jpg
Normal file
BIN
img/linus.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 117 KiB |
Loading…
Reference in New Issue
Block a user