Different Data records about open source projects - github

While working on my thesis project which has analyzing open source projects as a part of it, I found that different websites provide completely different records about some projects.
Lets take for example: Apache Camel.
Regarding openhub.net Apache Camel has 274 contributors, while in Github it has only 199 Contributors Apache Camel on Githup
So the question is: which one to trust?

GitHub only monitors activities on the master branch.
And it is a mirror of the actual repo https://www.openhub.net/p/camel, which has many branches.
See "Why are my contributions not showing up on my profile?" for the GitHub contribution policy.
Commits will appear on your contributions graph if they meet all of the following conditions:
The commits were made within the past year.
The email address used for the commits is associated with your GitHub account.
The commits were made in a standalone repository, not a fork.
The commits were made in the repository's default branch (usually master)
That openhub repo does count contribution done on all branches.

Related

Why is Github not picking up my contributions once I've connected my application to Netlify?

I've deployed an app on Netlify through continuous deployment by linking a single Github repo. I had previously been making commits to the project locally, and my contributions were being tracked for this repo. However, now that I've linked the repo to Netlify, it seems no commits or contributions I make are picked up by Github. The commits can still be seen in the Github repo and commits are updated, but the contributions no longer are tracked despite them working previously.
For some context I've checked the Github help page on contributions:
https://help.github.com/en/github/setting-up-and-managing-your-github-profile/why-are-my-contributions-not-showing-up-on-my-profile
And cannot see what rule I've violated; I'm working on this on my own, it's a standalone repo, etc etc. considering they were being tracked before for the same repo, I'm confused as to what has changed now that Netlify has been integrated.
Any help/guidance appreciated
So it had nothing to do with Netlify, but my work Mac did not have me globally installed as the commit author with my email. After that, all previous authors were wrong as being my local computer email.
To get around this I followed this tutorial to replace all previous commits with the correct author: How do I change the author and committer name/email for multiple commits?

GitHub Pages publishing from master vs master/docs or gh-pages branch

I've been able to publish GitHub sites under my domain on GitHub Pages from the master branch without issue, however in the docs it says to use a gh-pages branch or master/docs for publishing projects.
I also have a repository for my homepage index.html file/assets, where I link to each of the published GitHub repositories (which are published to my domain name.com/repo-name).
Why have I been able to publish from the master branch? Is there any reason to publish from the gh-pages branch or master/docs instead for publishing project repositories?
GitHub Pages can publish from any of those sources: gh-pages branch, master/docs, or just from the repo itself. It's more of a preference which route you use.
For example, Jekyll is publishing using the master/docs option. The rest of the repo outside of the docs folder is for the actual Jekyll code. One possible reason is that PR's with new features must also include documentation of that new feature. Otherwise, it won't get merged.
The gh-pages option means that code and documentation can be paced or managed differently. They live in the same repo, but the branches can grow at differing speeds.
In terms of technical differences, there's no technical costs/benefits to each option as far as I know. It's just how you want to organize your code and documentation.
Hope that helps!
GitHub requires user and organization sites to build from master, while project sites can build from gh-pages. If I understand correctly, you are publishing to your user site, i.e. yourusername.github.io.

What are the proper GitHub settings to prevent people from committing to the master branch?

I want to set up a proper workflow on GitHub where junior engineers submit pull request for code review and only the lead engineer can commit to the master branch.
I'm looking for input from professionals that work in a commercial software environment. I've found the page that does the permissions easy enough. There are several options. Restrict who can push to matching branches of course. Should I check others as well?
The other approach, beside the branch permission within one repo, is the gate repo:
you are setting up a public repo where developers can commit (on master or topic branches)
you are using a private, or repo within an organisation, from which you can pull
That way, you or your organisation team control the contribution you chose to include in the master of that main repository.

Eclipse Egit - is it possible to compare commits on different projects?

At the new workplace where I work, in the past, the main project was split in two branches, because different customers began to have very different requirements. A pretty common scenario I guess.
Now, I'am not a developer but a sysadmin, and not an expert of git, but I was wondering if in these cases usually is the correct approach to use branches, because in my understanding a fork would be more adapt.
What the CTO is asking me to do, is to migrate this branch, into a new git repository. But he also says that he wants to still be able to perform comparisons between commits, therefore (in eclipse + egit) to right-click on workspace > team > show in history > select the commits he wants to compare > click on compare to each other. I believe that these requirements conflict to each other, so my main question is: is it possible to compare commits of different git repositories?
My second question is, if a project with the same core that starts to require different features, should be branched forked or moved to a new repository?
Hope my question is not too broad
There is no concept called fork in Git. Git hosting services, such as Github or Gitlab, provide such a feature. As far as Git is concerned, a fork is essentially just a branch. And also, every clone of a repository - even local repositories - are essentially forks.
To split up your repository into two repositories that have a fork relationship, first just create a clone of the repository. And then delete branches in both repositories that refer to commits of the now-other-repository.
The usual approach to compare forks is to add a remote to the other remote. This is possible in your case too, since you have common commits in both repositories, before the forking-point. More on remotes here: What is "git remote add ..." and "git push origin master"?

Github do not count my commit

This is the story.
I have two computers, one is in my home, another is in my office. Both computers have installed Eclipse and connect to the same project of my github account wtih Egit. I find that when I commit on my home computer, my commit will be recorded and display on my contribution graph. However, when I commit on my office computer, commits will not be recorded.
To solve this problem, I delete projects both on my home computer and office computer, and create new project by cloning corresponding project on github.com with identical steps. Furthermore, I use the same eclipse version, they are the newest Mars. However, the problem still remains, commits on home computer will be recorded, and the other will not.
I searched the Internet and can not find the answer. Is there anybody here can help me out? Thanks in advance!
Problem solved. If someone else meet the similar problem, the following link will be quite useful. https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user
Just add your second machines SSH key (assuming you use them) to your account and you should be set. then clone your existing project from the repo, and start working normally. any changes, just commit/push, and from the other machine you can always pull any updates, vice versa.
Commits will appear on your contributions graph if they meet all of the following conditions:
The commits were made within the past year.
The email address used for the commits is associated with your GitHub account.
The commits were made in a standalone repository, not a fork.
The commits were made:
In the repository's default branch (usually master)
In the gh-pages branch (for repositories with Project Pages sites)
In addition, at least one of the following must be true:
You are a collaborator on the repository or are a member of the organization - that owns the repository.
You have forked the repository.
You have opened a pull request or issue in the repository.
You have starred the repository.
Contributions to private repositories will only appear to users who can access those repositories. Those contributions are not rendered for users who cannot access those repositories.