I just helped a friend to set up a Github account to collaborate on my project. His commits come through, but for some reason on the "Source" page of my repository next to his commit is only his name and not his username (with a link).
It seems strange, since Github obviously recognizes him (I added him to the list of collaborators etc.
Seems like a stupid question, but Google couldn't help.
Thanks!
Does your friend have the e-mail address he is using for his commits correctly set up as an alias in GitHub? Otherwise, how is GitHub to know who he is? Git itself only records the full name and the e-mail address and obviously not the GitHub username, since you can use Git perfectly fine without GitHub.
Run this in Terminal:
git config --global user.name "your-github-username"
git config --global user.email "your-github-email"
Add the email used in the git commits to github via Account Settings: Email Settings
Just ask your friend to add email that he use in local git commits to his GitHub account emails list as stated in GitHub Help
you can check the GitHub article:
$ git config --global user.name "example"
$ git config --global user.email "email#example.com"
Related
What is the difference between the local account that I set in git bash with git config --global user.name and my actual github account login. I have a test repo, in there I have added a few collaborators. When I push to the repo, the history will show my local name and not my github account username. How come ?
GitHub is not git. GitHub is a remote repository management application. It has its own authentication and account system. You can push git repositories to it so that they can be shared and controlled.
The "local" variables that you set through git config are ways to make it faster to set the author of a commit.
There is nothing stopping you from pushing commits authored by someone who is "not you" to a GitHub remote that you control. I believe they will be associatively "linked" if the emails match, but it's not enforced or required.
I am confused, GitHub shows me as two different people. I use the same account when pushing from my local repos and then checking it on GitHub.
I only have one account on GitHub. So it's a surprise to me I'd be shown as two different people.
It happens when you don't have the same email address on your local git configuration and on your GitHub account.
You can set your email address in git with this command:
git config --global user.email "email#example.com"
And on GitHub at this address: https://github.com/settings/emails
For more information, see GitHub's help:
Why are my commits linked to the wrong user?
Why is my commit associated with the wrong person?
Note that the changes will take effect for next commits, the commit history won't be changed, if you want to change the author or committer on already existing commits, you'll have to amend them.
Also had the same issue. This strange behaviour apparently only happens to me when the locally configured git email has caps:
Commits:
$ git log --pretty=full
commit b1149b046e31a82de34d550dda53637908d1956b (HEAD -> feature1,
origin/feature1)
Author: Sam <emailwithCaps#gmail.com>
Commit: Sam <emailwithCaps#gmail.com>
caps email
commit 0e1dcabfa7d3dc7f1333d2c15967ca6288515e42
Author: Sam <nonexistingemail#gmail.com>
Commit: Sam <nonexistingemail#gmail.com>
aasss2wq
As you can see, Author and Commiter have the same name and email on the commits.
On GitHub:
Commit Email with caps vs no caps on GitHub
Not sure why it happens.
Concluing: Making all characters lower case in the local git config user.email seemed to solve this for me.
The GitHub profile does not show my commits.
I have figured it out and posted my solution below.
I figured out out. I need to make sure the Gihub registered email is same as my local config email. so just set
git config --global user.email "myemail#xxx.com"
That's it.
Details:
https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/
Commits(for new or old branch) done after changing the username and email are linked to me while Pushes(for both old and new branch) are for old user.
Moreover if I setup a new project or anything new as generating ssh keys I get the message in terminal as previous user. How do I remove that previous user from my system so that everything done related to github from my system should be related to my account.
I changed the config file through this link , it is also showing the correct username and email
through git config --global user.name or git config --global user.email.
https://help.github.com/articles/setting-your-email-in-git/
Check in the console as
git config --list
It will list all your git configuration status.
then try
git config --global --unset-all user.name
and then
git config --global --add user.name <your_username>
You can try from this link also. See the 1st Answer
Hope it might work !!!
I have changed the username and email in git config via
https://help.github.com/articles/setting-your-email-in-git/
When I check the config file with git config --global user.name or email it is showing the correct email and username.
The commits in my project are linked to my github account while in the home page of github it is shown as previous_user pushed to master.
Why are commits linked to me while the pushes are linked to previous user.
I will be really very thankful if someone helps.