Pycharm commits to github not shown in my github history - github

When using username/password combo to commit to my Github account via Pycharm, I don't get green squares (badges) in my Github commit history. Commits are made to my own public repository
This is not that big technological issue but there are people who judge others based on number of those green squares.

Make sure that the email address that you use in your commits matches the email address of your github account. To change the email address, use git config user.email (see here for more information).

Related

Why am I able to push and send/receive pull requests but not on the contributor list in github?

I'm been working in a team of four. I'm in the collaborator list. I'm able to commit, push, send pull requests and merge in our repo. My teammates can see my changes, but everyone is on the contributor list except me.
I double checked my email address, make sure the email I used in my local setting is the same with my default email in the github account.
We have changed the owner of the project once, and I'm still using the old url. Is this the reason for that?
I found the github has a complex rule for you be considered as a contributor. Here's the doc of it.
https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/managing-contribution-settings-on-your-profile/why-are-my-contributions-not-showing-up-on-my-profile
You have to commit to the main/default branch or make pull requests. To commit into other branches won't count.
Also, to use the old project url is definately one problem. In the project insight, everyone's profile is linked with their username. While mine is only a username with no user icon.
I think I just accidentally hit into one of the corner cases, but I'm still very confused of this design pattern.

Why am I not showing up as contributor in github?

Why my github commits are like this. Is this the reason that I am not showing up as a contributor.
If you don't appear in a repository's contributors graph, it may be because:
You aren't one of the top 100 contributors.
Your commits haven't been merged into the default branch.
The email address you used to author the commits isn't connected to your account on GitHub.
source

Github transfer contributions from one account to another

I have googled it a lot but didn't find any clear answer if it possible and how to do it.
I have an account from which I have contributions to a private repo. I don't have any repositories.
I want all those contributions to go to my new account (There I have repositories).
Is that possible? Do I still have access to that private repo after transfer the contributions?
You would need to rewrite commits which would create new hashes (the committer's name is part of the data used to calculate the hash).
This would mean all commits that reference these commits (the parent commits also being part of the data used to calculate the hash) would also need to be regenerated (rebase allows this to be done in bulk).
All of this would require forcing pushes as well (so all other contributor's local repositories are going to be impacted).
Even if github can automate some of this, it is a massive impact.
TL;DR: yes, but you probably should accept it is hard to rewrite history.
Guessing from the tags I assume you're talking about GitHub accounts. GitHub calculates contributions based on the author email address used in Git commits, and if there is a GitHub account that uses this email address, your GitHub user name shows up as a contributor. That said, you can associate multiple email addresses with a single GitHub account. So if you unregister your current email address from your old GitHub account, and register the same email address for your new GitHub account, existing contributions will show under your new GitHub account.
Do I still have access to that private repo after transfer the contributions?
That's a totally different question, and the answer depends on whether your new GitHub account was given access to the private repository. The GitHub permissions system is based on the GitHub user name, not on registered email addresses.

How to keep Email on GitHub private, but still make contributions visible?

I have an email which linked to GitHub account and I don't want it to be visible for people. So I set it private like this:
Having this configuration you cannot push changes with your email set in git.
If you set any other string as git email, it will be performed, but in contributions block there will be no contributions visible.
How to keep Email on GitHub private, but still make contributions visible?
If you look in Keep my email address private line, you will see this comment:
We’ll remove your public profile email and use
25605156+yourgithubid#users.noreply.github.com when performing
web-based Git operations and sending email on your behalf.
So if you attach this generated email to your git, changes will be pushed successfully, and you'll see your commits in contribution board.

Can I associate a GitHub user with his commits by name only, BitBucket-style?

I've seen Github shows name instead of a linked username in commits and I realise that the right thing to do is to link by email. However, I already have a repository with a whole bunch of commits whose email is "none#none".
On BitBucket, I can specify a per-project mapping of committer name to BitBucket account, and this has worked well enough. Is there anything like this on GitHub?
If not, what other options are there, short of leaving the commits unlinked and rewriting the entire history?
You can use .mailmap file in your repo, for mail aliased (as stated in "“Alias” git authors/committers?")
You also can add another email in your Email setting account.
But both solutions don't scale well when several authors use the same none#none email.