Re: [git-users] changing email in one repo
On 08/12/2016 06:16 PM, Konstantin Khomoutov wrote: > On Fri, 12 Aug 2016 17:50:12 +0200 wrote: > >> I have a repo (also hosted at Gitlab) that uses an email address that >> I would like to remove from the whole repo (and replace with another >> one). >> >> All contributions to that repo are mine. Is there any way that I can >> replace all email addresses in both my local repo and the remote? > > Sort of. > > The e-mail address is a part of the so-called "author" and "committer" > fields in the commit objects representing all the affected commits in > your repository. > > So, to do what you need you need to actually re-write all these commits > objects. Here's how to do this [1]. > [...] > 1. https://help.github.com/articles/changing-author-info/ Many thanks for your reply, Konstantin. It was what I needed it. My repo is private and it has been never been cloned. BTW, is there any other way to check for errors than to search for any original ref in refs/original/? Many thanks for your help again, Pablo -- http://www.ousia.tk -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] changing email in one repo
Hello, yes, there is a way, it can be easily done with git filter-branch. However, before going where no one should, let's dive in on the consequences. A commit object consists of a bunch of things, like the commit message, the root tree object's hash, and in your case the most important, an author date, commit date, author name and committer name. When you change any of these in one commit, the SHA1 hash of that commit changes. And, as a commit also contains the SHA1 of its parent, if you change one commit, you change all commits that descend from that one. If you are the only committer in that repo, it is more than likely that the author and committer is both set to your name+address, so you will change all the commits anyway, so you don't have to worry about all the above. But you mentioned the repo is hosted on GitLab. So what happens if someone have already cloned your repository? They will have a root commit with different metadata, and Git will complain about unrelated histories (or not; someone please confirm or deny this fact). All in all, it is possible, but you probably don't want to do this. If you really do, see [1]. Best, Gergely [1] http://stackoverflow.com/a/4494037/1305139 On Fri, Aug 12, 2016, 17:49 Pablo Rodríguez wrote: > Dear list, > > I have a repo (also hosted at Gitlab) that uses an email address that I > would like to remove from the whole repo (and replace with another one). > > All contributions to that repo are mine. Is there any way that I can > replace all email addresses in both my local repo and the remote? > > Many thanks for your help, > > Pablo > -- > http://www.ousia.tk > > -- > You received this message because you are subscribed to the Google Groups > "Git for human beings" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to git-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] changing email in one repo
On Fri, 12 Aug 2016 17:50:12 +0200 Pablo Rodríguez wrote: > I have a repo (also hosted at Gitlab) that uses an email address that > I would like to remove from the whole repo (and replace with another > one). > > All contributions to that repo are mine. Is there any way that I can > replace all email addresses in both my local repo and the remote? Sort of. The e-mail address is a part of the so-called "author" and "committer" fields in the commit objects representing all the affected commits in your repository. So, to do what you need you need to actually re-write all these commits objects. Here's how to do this [1]. A note of warning. Since commits link to each other using the SHA-1 hashes calculated over their contents, and it includes the commit object itself, these hashes will be different for the re-created commits. To say this in other words, while semantically the history of your repository will remain the same -- in the sense that each re-written commit will represent exactly the set of changes the commit it replaced was, _literally_ all the history will be different because all the commits will have hashes different from the original. This means that whoever forked your repository or merely cloned it and based some their own work on that history, will need to re-fork, re-clone and take actions to accomodate this change. This situation is well described in the section "RECOVERING FROM UPSTREAM REBASE" of the `git rebase` manual page. Please be sure to read and understand it before you actually decide to do what you want. I'd say that unless it's your private repo and you therefore have full control over all of its clones, it would be much better to just update the repo's README file with the information on the change of your e-mail address. And then just do all the new commits there using the updated e-mail address. 1. https://help.github.com/articles/changing-author-info/ -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[git-users] changing email in one repo
Dear list, I have a repo (also hosted at Gitlab) that uses an email address that I would like to remove from the whole repo (and replace with another one). All contributions to that repo are mine. Is there any way that I can replace all email addresses in both my local repo and the remote? Many thanks for your help, Pablo -- http://www.ousia.tk -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.