I have a local clone with my commits showing author and email id as UserA since i have configured my clone with git config.
I fetched and merged some commits from my colleague's clone (UserB) whoc is also working on the same project, to my clone instead of fetching and merging from the parent project.
My Git log, shows commits made by me and commits made by my colleague.
Question i have here is
1)Gerrit code review recogniz开发者_运维知识库es commit in the parent project. So when i push from my local clone, the commits i pulled from my colleague as not recognized and i get this error
! [remote rejected] HEAD -> refs/for/project1 (you are not committer UserB@xyz.com)
Can someone help me with this Gerrit error?
2)How can i identify whether a commit that has my colleague's name is pull from the parent project or pulled directly from my colleague's clone
1) Gerrit checks all changes for mail adresses. Only if all changes have mail addresses, that are configured in the user account who pushes the changes, Gerrit will let them go through. However, if you need to bypass this check, you need to give your user the access permission "Forge Author Identity" and "Forge committer identity".
2) The only way this would be possible is to look, if the parent repository doesn't contain that commits. If so, then the only way you could get them was to fetch directly from your colleague. However, if the commits are already pushed to the parent repository, i don't know a way to definitely say, from which repository a commit was pulled. But i also don't see a requirement why this would be necessary.
精彩评论