Tried to update some commit authors in a repo but says authored by X, commited by Y
I noticed something which might be beneficial to me, but i was not sure what was going on with my version. How to change the commit author for one specific commit?
So, I saw a great 1-liner which would say, start at the first commit, and ammend all authors to XXX. I thought it was going to work, but when I pushed, it said multple heads. I pulled and pushed and noticed that when looking at the repo history, I saw a bunch files now saying:
Authored by X, Comitted by Y.
I was hoping to strip and update all emails accordingly for some repos with relevant or correct spellings etc.
My desired end state is to completely override and replace it, so it never shows up in the git history at all. It seems that my way is not quite correct.
The reason is that I have broken or Invalid Authors/Committers, and emails etc. I want to be able to update them, and eventually set up a system to do auto-email routing to colleagues who no longer work at our company.
git github
add a comment |
I noticed something which might be beneficial to me, but i was not sure what was going on with my version. How to change the commit author for one specific commit?
So, I saw a great 1-liner which would say, start at the first commit, and ammend all authors to XXX. I thought it was going to work, but when I pushed, it said multple heads. I pulled and pushed and noticed that when looking at the repo history, I saw a bunch files now saying:
Authored by X, Comitted by Y.
I was hoping to strip and update all emails accordingly for some repos with relevant or correct spellings etc.
My desired end state is to completely override and replace it, so it never shows up in the git history at all. It seems that my way is not quite correct.
The reason is that I have broken or Invalid Authors/Committers, and emails etc. I want to be able to update them, and eventually set up a system to do auto-email routing to colleagues who no longer work at our company.
git github
Why are you trying to rewrite the history of a GitHub repo? This is generally a bad thing to do.
– Tim Biegeleisen
Nov 13 '18 at 2:25
I was working on some of my repos, and i noticed wrong, broken, or incorrect Author names, emails etc... So if i can figure out how to properly accomplish this, I could expand it to not just replace entirely, but tweaks etc. It seems like it would laterally help my work as well, as I have different users for different teams, and I want to eventually scan and update those as well
– Fallenreaper
Nov 13 '18 at 2:29
@TimBiegeleisen I also noticed that GIT has an example of this as well help.github.com/articles/changing-author-info/#platform-mac but it seems that even after I make the adjustments, I still dont see it work explicitly as designed, given my old email was "1234567"
– Fallenreaper
Nov 13 '18 at 3:19
@Fallenreaper, have you looked intogit-filter-branch
? This answer looks to be up your alley - stackoverflow.com/questions/4493936/…
– miqh
Nov 13 '18 at 3:21
@miqh I was looking into it, and with github help section, they were also listing that as an option. I was looking at the code snippet from your link:git filter-branch --commit-filter 'if [ "$GIT_COMMITTER_EMAIL” = “1234567” ]; then export GIT_AUTHOR_NAME=“MYNAME”; export GIT_AUTHOR_EMAIL=TEST@EMAIL.COM; fi; git commit-tree "$@"'
but it gives me an unexpected EOF.
– Fallenreaper
Nov 13 '18 at 4:09
add a comment |
I noticed something which might be beneficial to me, but i was not sure what was going on with my version. How to change the commit author for one specific commit?
So, I saw a great 1-liner which would say, start at the first commit, and ammend all authors to XXX. I thought it was going to work, but when I pushed, it said multple heads. I pulled and pushed and noticed that when looking at the repo history, I saw a bunch files now saying:
Authored by X, Comitted by Y.
I was hoping to strip and update all emails accordingly for some repos with relevant or correct spellings etc.
My desired end state is to completely override and replace it, so it never shows up in the git history at all. It seems that my way is not quite correct.
The reason is that I have broken or Invalid Authors/Committers, and emails etc. I want to be able to update them, and eventually set up a system to do auto-email routing to colleagues who no longer work at our company.
git github
I noticed something which might be beneficial to me, but i was not sure what was going on with my version. How to change the commit author for one specific commit?
So, I saw a great 1-liner which would say, start at the first commit, and ammend all authors to XXX. I thought it was going to work, but when I pushed, it said multple heads. I pulled and pushed and noticed that when looking at the repo history, I saw a bunch files now saying:
Authored by X, Comitted by Y.
I was hoping to strip and update all emails accordingly for some repos with relevant or correct spellings etc.
My desired end state is to completely override and replace it, so it never shows up in the git history at all. It seems that my way is not quite correct.
The reason is that I have broken or Invalid Authors/Committers, and emails etc. I want to be able to update them, and eventually set up a system to do auto-email routing to colleagues who no longer work at our company.
git github
git github
edited Nov 13 '18 at 2:34
Fallenreaper
asked Nov 13 '18 at 2:23
FallenreaperFallenreaper
4,13483484
4,13483484
Why are you trying to rewrite the history of a GitHub repo? This is generally a bad thing to do.
– Tim Biegeleisen
Nov 13 '18 at 2:25
I was working on some of my repos, and i noticed wrong, broken, or incorrect Author names, emails etc... So if i can figure out how to properly accomplish this, I could expand it to not just replace entirely, but tweaks etc. It seems like it would laterally help my work as well, as I have different users for different teams, and I want to eventually scan and update those as well
– Fallenreaper
Nov 13 '18 at 2:29
@TimBiegeleisen I also noticed that GIT has an example of this as well help.github.com/articles/changing-author-info/#platform-mac but it seems that even after I make the adjustments, I still dont see it work explicitly as designed, given my old email was "1234567"
– Fallenreaper
Nov 13 '18 at 3:19
@Fallenreaper, have you looked intogit-filter-branch
? This answer looks to be up your alley - stackoverflow.com/questions/4493936/…
– miqh
Nov 13 '18 at 3:21
@miqh I was looking into it, and with github help section, they were also listing that as an option. I was looking at the code snippet from your link:git filter-branch --commit-filter 'if [ "$GIT_COMMITTER_EMAIL” = “1234567” ]; then export GIT_AUTHOR_NAME=“MYNAME”; export GIT_AUTHOR_EMAIL=TEST@EMAIL.COM; fi; git commit-tree "$@"'
but it gives me an unexpected EOF.
– Fallenreaper
Nov 13 '18 at 4:09
add a comment |
Why are you trying to rewrite the history of a GitHub repo? This is generally a bad thing to do.
– Tim Biegeleisen
Nov 13 '18 at 2:25
I was working on some of my repos, and i noticed wrong, broken, or incorrect Author names, emails etc... So if i can figure out how to properly accomplish this, I could expand it to not just replace entirely, but tweaks etc. It seems like it would laterally help my work as well, as I have different users for different teams, and I want to eventually scan and update those as well
– Fallenreaper
Nov 13 '18 at 2:29
@TimBiegeleisen I also noticed that GIT has an example of this as well help.github.com/articles/changing-author-info/#platform-mac but it seems that even after I make the adjustments, I still dont see it work explicitly as designed, given my old email was "1234567"
– Fallenreaper
Nov 13 '18 at 3:19
@Fallenreaper, have you looked intogit-filter-branch
? This answer looks to be up your alley - stackoverflow.com/questions/4493936/…
– miqh
Nov 13 '18 at 3:21
@miqh I was looking into it, and with github help section, they were also listing that as an option. I was looking at the code snippet from your link:git filter-branch --commit-filter 'if [ "$GIT_COMMITTER_EMAIL” = “1234567” ]; then export GIT_AUTHOR_NAME=“MYNAME”; export GIT_AUTHOR_EMAIL=TEST@EMAIL.COM; fi; git commit-tree "$@"'
but it gives me an unexpected EOF.
– Fallenreaper
Nov 13 '18 at 4:09
Why are you trying to rewrite the history of a GitHub repo? This is generally a bad thing to do.
– Tim Biegeleisen
Nov 13 '18 at 2:25
Why are you trying to rewrite the history of a GitHub repo? This is generally a bad thing to do.
– Tim Biegeleisen
Nov 13 '18 at 2:25
I was working on some of my repos, and i noticed wrong, broken, or incorrect Author names, emails etc... So if i can figure out how to properly accomplish this, I could expand it to not just replace entirely, but tweaks etc. It seems like it would laterally help my work as well, as I have different users for different teams, and I want to eventually scan and update those as well
– Fallenreaper
Nov 13 '18 at 2:29
I was working on some of my repos, and i noticed wrong, broken, or incorrect Author names, emails etc... So if i can figure out how to properly accomplish this, I could expand it to not just replace entirely, but tweaks etc. It seems like it would laterally help my work as well, as I have different users for different teams, and I want to eventually scan and update those as well
– Fallenreaper
Nov 13 '18 at 2:29
@TimBiegeleisen I also noticed that GIT has an example of this as well help.github.com/articles/changing-author-info/#platform-mac but it seems that even after I make the adjustments, I still dont see it work explicitly as designed, given my old email was "1234567"
– Fallenreaper
Nov 13 '18 at 3:19
@TimBiegeleisen I also noticed that GIT has an example of this as well help.github.com/articles/changing-author-info/#platform-mac but it seems that even after I make the adjustments, I still dont see it work explicitly as designed, given my old email was "1234567"
– Fallenreaper
Nov 13 '18 at 3:19
@Fallenreaper, have you looked into
git-filter-branch
? This answer looks to be up your alley - stackoverflow.com/questions/4493936/…– miqh
Nov 13 '18 at 3:21
@Fallenreaper, have you looked into
git-filter-branch
? This answer looks to be up your alley - stackoverflow.com/questions/4493936/…– miqh
Nov 13 '18 at 3:21
@miqh I was looking into it, and with github help section, they were also listing that as an option. I was looking at the code snippet from your link:
git filter-branch --commit-filter 'if [ "$GIT_COMMITTER_EMAIL” = “1234567” ]; then export GIT_AUTHOR_NAME=“MYNAME”; export GIT_AUTHOR_EMAIL=TEST@EMAIL.COM; fi; git commit-tree "$@"'
but it gives me an unexpected EOF.– Fallenreaper
Nov 13 '18 at 4:09
@miqh I was looking into it, and with github help section, they were also listing that as an option. I was looking at the code snippet from your link:
git filter-branch --commit-filter 'if [ "$GIT_COMMITTER_EMAIL” = “1234567” ]; then export GIT_AUTHOR_NAME=“MYNAME”; export GIT_AUTHOR_EMAIL=TEST@EMAIL.COM; fi; git commit-tree "$@"'
but it gives me an unexpected EOF.– Fallenreaper
Nov 13 '18 at 4:09
add a comment |
1 Answer
1
active
oldest
votes
You should:
apply a filter-branch (as in here) changing both the author and committer.
That will avoid seeing "authored by X, committed by Y"git push --force
at the end, in order to overwrite the remote repo history (make sure to warn any collaborator on that repo first)
This works perfectly. I was having issues and tried a bunch of different options. I am not sure why it is suddenly working today, but either way, i am happy.
– Fallenreaper
Nov 13 '18 at 23:08
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53272865%2ftried-to-update-some-commit-authors-in-a-repo-but-says-authored-by-x-commited-b%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You should:
apply a filter-branch (as in here) changing both the author and committer.
That will avoid seeing "authored by X, committed by Y"git push --force
at the end, in order to overwrite the remote repo history (make sure to warn any collaborator on that repo first)
This works perfectly. I was having issues and tried a bunch of different options. I am not sure why it is suddenly working today, but either way, i am happy.
– Fallenreaper
Nov 13 '18 at 23:08
add a comment |
You should:
apply a filter-branch (as in here) changing both the author and committer.
That will avoid seeing "authored by X, committed by Y"git push --force
at the end, in order to overwrite the remote repo history (make sure to warn any collaborator on that repo first)
This works perfectly. I was having issues and tried a bunch of different options. I am not sure why it is suddenly working today, but either way, i am happy.
– Fallenreaper
Nov 13 '18 at 23:08
add a comment |
You should:
apply a filter-branch (as in here) changing both the author and committer.
That will avoid seeing "authored by X, committed by Y"git push --force
at the end, in order to overwrite the remote repo history (make sure to warn any collaborator on that repo first)
You should:
apply a filter-branch (as in here) changing both the author and committer.
That will avoid seeing "authored by X, committed by Y"git push --force
at the end, in order to overwrite the remote repo history (make sure to warn any collaborator on that repo first)
answered Nov 13 '18 at 5:37
VonCVonC
848k29626973253
848k29626973253
This works perfectly. I was having issues and tried a bunch of different options. I am not sure why it is suddenly working today, but either way, i am happy.
– Fallenreaper
Nov 13 '18 at 23:08
add a comment |
This works perfectly. I was having issues and tried a bunch of different options. I am not sure why it is suddenly working today, but either way, i am happy.
– Fallenreaper
Nov 13 '18 at 23:08
This works perfectly. I was having issues and tried a bunch of different options. I am not sure why it is suddenly working today, but either way, i am happy.
– Fallenreaper
Nov 13 '18 at 23:08
This works perfectly. I was having issues and tried a bunch of different options. I am not sure why it is suddenly working today, but either way, i am happy.
– Fallenreaper
Nov 13 '18 at 23:08
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53272865%2ftried-to-update-some-commit-authors-in-a-repo-but-says-authored-by-x-commited-b%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why are you trying to rewrite the history of a GitHub repo? This is generally a bad thing to do.
– Tim Biegeleisen
Nov 13 '18 at 2:25
I was working on some of my repos, and i noticed wrong, broken, or incorrect Author names, emails etc... So if i can figure out how to properly accomplish this, I could expand it to not just replace entirely, but tweaks etc. It seems like it would laterally help my work as well, as I have different users for different teams, and I want to eventually scan and update those as well
– Fallenreaper
Nov 13 '18 at 2:29
@TimBiegeleisen I also noticed that GIT has an example of this as well help.github.com/articles/changing-author-info/#platform-mac but it seems that even after I make the adjustments, I still dont see it work explicitly as designed, given my old email was "1234567"
– Fallenreaper
Nov 13 '18 at 3:19
@Fallenreaper, have you looked into
git-filter-branch
? This answer looks to be up your alley - stackoverflow.com/questions/4493936/…– miqh
Nov 13 '18 at 3:21
@miqh I was looking into it, and with github help section, they were also listing that as an option. I was looking at the code snippet from your link:
git filter-branch --commit-filter 'if [ "$GIT_COMMITTER_EMAIL” = “1234567” ]; then export GIT_AUTHOR_NAME=“MYNAME”; export GIT_AUTHOR_EMAIL=TEST@EMAIL.COM; fi; git commit-tree "$@"'
but it gives me an unexpected EOF.– Fallenreaper
Nov 13 '18 at 4:09