When i push into github from vs code it shows me the wrong user even though i have signed in with the right account - github

I am having a issue every time I push code into GitHub:
I have this account
and this is what it shows after I do a commit:
This is a name or nickname I have never used, and this shows for private repositories and public repositories as well.
After doing some research, I have removed Windows credentials of GitHub and VSCode to make sure that the issue does not stand there:
It did not resolve the issue.
I have tried the command to remove all credentials and add them again, I added them again but the issue still persists.
For some reason, every time I make a commit, unless I upload directly the code from github.com, it will show it with the wrong user as push.

Credentials are use to authenticate to GitHub, which check if your account (identified by the credentials) has the right to access/push to your remote repository.
This has nothing to do with commit authorship, which is only set by a local git config --global user.name or user.email.
Check first those settings, adjust them (especially the email one), and make/push another commit, to confirm they are properly displayed (with the right account)

Related

SourceTree keeps prompting for credentials for an old and unused remote source

I pulled an old repo that has a submodule from e.g. stash.oldCompany.com/oldModule. I used to have credentials for it, but the entire thing was moved to a different public repo. I think the old repo still exists, but I sure don't have access there anymore.
Anyway, I entered vim .gitmodules and altered the submodule url to point at the public repo, and it works perfectly.
However - SourceTree still prompts me for credentials of the OLD url every single time I tab into SourceTree.
I don't have any repos that reference this URL anymore, directly or as submodule, yet it keeps prompting for credentials. Many people seem to be reporting similar behavior, and people keep suggesting entering SourceTree-settings and resetting the git-version, but I've tried that, but it still happens. That's a different problem anyway, because that's a prompt for logging into a repo they're actually using.
It feels like SourceTree is stuck in a loop of trying to authenticate me to a repo I accidentally attempted to pull as a submodule in a project that no longer utilize it. How do I get it out of this loop? It's driving me mad.

Sourcetree pushing with the wrong user?

Background:
I have two GitHub accounts: a main account and a rarely-used account.
If I remember correctly, I have used both of them with the copy of Sourcetree on my laptop.
I currently have just my main GitHub account listed in my Sourcetree's Tools-->Options-->Authentication settings page.
Problem:
When I try to push a branch from my laptop to my GitHub remote for my main account, it fails, with the git error message indicating that I had actually tried to push with my rarely-used account, even though it's nowhere to be found in my Sourcetree settings pages.
The Atlassian team provided a solution for this (here):
Open the repo
Click "Settings"
Double click on the "origin" item in the listing
Edit the url to add your username before the URL of the repo. Here are some examples:
https://USERNAME#contoso.com/repo/blah.git
https://USERNAME#github.com/host/repo_name
You should be prompted for a password the next time you try to push or pull
I was able to solve the problem by opening up my Sourcetree userhosts file, located at (on Windows 10): C:\Users\<USERNAME>\AppData\Local\Atlassian\SourceTree\userhosts, as hinted at in Atlassian's documentation for how to reset your Sourctree settings.
The file only contained these lines:
github.com
<my-rarely-used-account>#gmail.com
I deleted that second line which referenced my rarely-used account, restarted Sourcetree, tried to push again, and this time it prompted me for my GitHub password, and I could see that the username was (correctly) my main GitHub username. I entered my password and the push succeeded.

github desktop error “The repository does not seem to exist anymore. You may not have access, or it may have been deleted or renamed.”

I have installed GitHub Desktop as the uploaded local project tool, I uploaded a project "F:/test", and it could show successful in my GitHub homepage, then I delete this repository.
But I re-publish this project to GitHub.
Github Desktop shows this history of the repository, and prompt error
The repository does not seem to exist anymore.
You may not have [enter access, or it may have been deleted or renamed
How can I get past this error message?
This error was keeps on occurring to me. Turn out I was not added as the Contributor on the GitHub project.
The repo owner should be able to see and list of Contributor for the project. You can request him to add you in contributor list and this error will disappear.
I was facing the same issue, I simply sign out from Github Desktop app in File > options > Signout
In my case I accidentally changed the push Url, so I executed:
git remote set-url --push origin https://github.com/username/repo.git
After that I checked with:
git remote show origin
your Fetch Url and Push Url must look like the same URL where you cloned the project.
As shown in this error, it is the result of an invalid local path. Either because it includes invalid characters, or because you don't have write/admin access to it (read access is not enough).
If you can, clone again that repo in a different path and open it with GitHub Desktop, and see if the issue persists.
I had the same issue. I deleted my repository from remote as well and then recreated.
If you aren't worried about the change trace being lost, then you can simply remove the .git folder (you will need to enable hidden files in windows) and then re-initialize the repository in the project folder.
This resolved the problem for me!
In my case I have used more than one account. Just sign out from GitHub Desktop and sign in back to the specific account. You might sign out any logged GitHub session on the default web browser if the account is not what you want.
Since I had a forked repository, I had spelled my url wrong in
github desktop -> repository -> repository settings...
I had a link called github.com/myname/myproject.it
but instead of it I hade to write git.
github.com/myname/myproject.git
I was logged in with the wrong account! I had to sign out of Github in the browser first, then sign out in Github Desktop and re-sign in

Github for Mac: Pull Request Button is missing

Saturday I installed Github Desktop on my Mac and tried the Github Workflow. Created a branch, committed changes and did a Pull Request. Everything worked.
Today I installed Github for Mac at work - and the Pull Request Button is no where to be found. I'm back home now on my private Mac and the button is missing here as well now.
As you can see on the last screenshot, the branch is up on github.com and ready for a PR. Also the dots in Github for Desktops Timeline (top right) are small, which means the commits are pushed. And there are changes to the dev branch (second screenshots).
Am I doing something wrong?
Update: maybe my branch isn't eligible for a PR? Because the menu item is also greyed out:
I have two branches, they have committed (and pushed) differences... hm.
Another way of doing this (it worked for me) is to go to:
"Preferences" > "Sign out" > "Sign in" (again)
That way you'll reset your Github desktop (don't worry. You won't lose anything :) )
I finally got it. As you can see in the screenshots my repository is marked as "other". That's because it was already on my machine and I've not cloned it in Github for Desktop. I just added it.
I cloned that repository as follows
https://githubusername:githubpassword#github.com/organization/repo.git
That URL as remote.origin.url probably isn't handled by Github for Desktop so the Repo is marked as "other".
Weird. I recloned my repositories and now everything is working fine.
this is my own issue which is a specific case:
On linux:
my friend gave a laptop to me.
I had a same issue on my friend's laptop that he gave it to me with his github credentials. I did change my username and email in the git config --global and I send a PR, but I didn't see the compare and pull request button. I
I asked him and he was able to see the compare and pull request button.
I remove his ~./ssh/id_rsa.pub and ~./ssh/id_rsa public and his private keys, and replace it with my own laptop public and his private keys. and it worked.
it's like when you login to github, github saves your public key.
so I was able to see the button.

Changing github identifiers in eclipse

I am working on a project shared through github and eclipse, and I can commit without problems, my partner however, entered the wrong identifiers(username and password) the first time he remote pushed. Thus, every time he tries to push and commit on the repository, eclipse uses those wrong identifiers to log to github and it fails. Is there a way to change those identifiers?
If he entered the wrong username, he can go on Window/Preferences/ search for git and on Configuration section, he can change this.
Otherwise if entered the wrong password, he can search for secure and on the Secure storage section, on Contents tab, he can change the password on git section