I making project for my friend but after few commits i see the problem. I thinked if im log in on his account it will be created like him. But it was created my other author(me). Can i change this on gitlab ? If is options to change it without changing data commits.
Asked
Active
Viewed 4,978 times
4
-
Possible duplicate of [How to change the author and committer name and e-mail of multiple commits in Git?](https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi) – phd Dec 20 '18 at 03:52
-
https://stackoverflow.com/search?q=%5Bgit%5D+change+commit+author – phd Dec 20 '18 at 03:52
1 Answers
7
Yes you can. Clone the repo locally, then use filter branch
git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "John Doe" ];
then export GIT_AUTHOR_NAME="My Friend"; export GIT_AUTHOR_EMAIL=friend@friends.com;
fi; git commit-tree "$@"'

Adam Dymitruk
- 124,556
- 26
- 146
- 141
-
@MrSCoder - That command is written correctly and it works. If you run `git log` you will see the current author name, that must match the `$GIT_AUTHOR_NAME`. As long as you do that, it should work. – mike Feb 28 '20 at 07:24
-
yes i see on log data , i am getting error WARNING: Ref 'refs/heads/mybranch' is unchanged, my name same in both user correct one is Xyz Abc miss name xyz abc both user gitlab username and email are complete different Currently i want to remove xyz abc user from comments user list – Mr Coder Feb 28 '20 at 11:38