change author of git commit
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
16
git.md
16
git.md
@@ -8,4 +8,18 @@ git push --set-upstream <remote-path> <new-branch-name>
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
git restore .
|
git restore .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
3. Rename author
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git filter-branch -f --env-filter '
|
||||||
|
NEW_NAME="<new-name>"
|
||||||
|
NEW_EMAIL="<new-email>"
|
||||||
|
export GIT_AUTHOR_NAME="$NEW_NAME"
|
||||||
|
export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
|
||||||
|
export GIT_COMMITTER_NAME="$NEW_NAME"
|
||||||
|
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
|
||||||
|
' --tag-name-filter cat -- --all
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user