I pushed to a private repo from account that doesn't have access (I have both accounts linked in webstorm)

Hi,
I’m working on a work project, I have work github account, and a personal one.
I’ve connected both accounts on IntelliJ Webstorm.
The work account has access to the private repo. the personal account doesn’t
When I pushed some changes to that private repo, it showed up on github with my personal account!!! (the one that doesn’t have access to the private repo)
Does anybody have idea what caused this? or any possible explanation?

The commits don’t show up anywhere on my personal account. but the commits on the private repo are linked to my personal account!!
Any idea about what’s going on?

Hi @mbassem-elements, I think what’s going on here is that even though you’re using the account with permission to push, it sounds like you’re probably using the account without permission to sign your commits. Even though you you’re pushing with the correct account, the other account is showing up because commits get associated to accounts by email.

You may want to look into our support article on changing commit history so that you can replace one email address with the other.

2 Likes

I think what’s going on here is that even though you’re using the account with permission to push, it sounds like you’re probably using the account without permission to sign your commits. Even though you you’re pushing with the correct account, the other account is showing up because commits get associated to accounts by email.

I had a relatively similar thought about that as a cause of that problem. I’m using IntelliJ webstorm. Is that a bug related to IntelliJ Webstorm github plugin, or Github API?

It may be from the github plugin in webstorm, but I thought that github API will reject the PUSH if the user doesn’t have access …

I’ve submit a ticket to webstorm with more details about issue description here https://youtrack.jetbrains.com/issue/WEB-46208

GitHub will reject the push if the user doing the push itself doesn’t have access, that is correct. However, it doesn’t check all of the commits in that push to see if those associated users have access. It only checks the credentials to make the push.

1 Like

I got a similar understanding from the response on the webstorm ticket.
https://youtrack.jetbrains.com/issue/IDEA-244354?p=WEB-46208

Thanks for your further clarification.

BTW. is that behavior related to github? or git in general?

A little bit of both, I think. However, the core of that functionality with authenticating on push but not on commit is part of Git itself. It allows for users to collaborate amongst themselves and control who pushes changes to a particular repository.

It also allows for people to accept pull requests from other people and to merge them in once they’ve checked that the code works without needing to give that other person write access to the repository.

1 Like

A little bit of both, I think. However, the core of that functionality with authenticating on push but not on commit is part of Git itself. It allows for users to collaborate amongst themselves and control who pushes changes to a particular repository.

That part makes it clearer.

It also allows for people to accept pull requests from other people and to merge them in once they’ve checked that the code works without needing to give that other person write access to the repository.

It makes sense if I forked a repo, made changes and made a pull request.
But what if that repo is private? does that still apply? I mean, in that case, I won’t be able to make a pull request in the first place…

1 Like

Correct, that workflow doesn’t work for private repositories. But that doesn’t mean that you couldn’t have done pretty much the same thing without using pull requests. This portion of Git allows for that sort of collaboration even if it’s prevented by a different portion. The key though is that the authenticated person has control over what goes into the remote repository.

1 Like

Ok, Many Thanks for clearing all that stuff up :grinning:

Have a nice day

1 Like