-
Select Topic AreaQuestion BodyHello. For a long time I can not fix one problem. Earlier, I added my second github account to git in order to create repositories from this account and work on them, but now I don’t need it anymore, but I can’t remove the second account from the terminal in any way. Each "push" is done on behalf of the second account. I need to completely remove it in order to push on behalf of my main account. Note: The second account is permanently added as "contributors" to the main account. Who can help me with this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
1. Remove the remote URL for the second account:
6. Push to origin to make sure you are pushing with your main account: |
Beta Was this translation helpful? Give feedback.
-
It sounds like you're trying to remove a secondary GitHub account from your local Git configuration and have your commits associated with your primary account instead. If the secondary account is set as a contributor in your repositories, it shouldn't directly affect the way you push commits from your local machine. Here's a step-by-step guide to help you resolve this issue: Step 1: Check Global Configuration
Step 2: Update Global Configuration
Step 3: Check Repository-specific Configuration
Step 4: Check Remote URLs
Step 5: Commit and Push Remember that Git tracks your identity on a per-repository basis, so each repository can have different user information set. Make sure you're updating both global and repository-specific configurations if needed. If you continue to face issues, it might help to provide more specific details about the commands you're using and any error messages you're encountering. |
Beta Was this translation helpful? Give feedback.
1. Remove the remote URL for the second account:
git remote remove origin
2. Remove the credentials for the second account:
git credential-manager reject https://github.com
3. Re-add the remote URL for your main account:
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
4. Verify that the origin remote points to your main account:
git remote -v
5. Set the username and email to use your main account details:
6. Push to origin to make sure you are pushing with your main account:
git push origin master