GitHub specifically put out a changelog about the stargazers API endpoint to restrict open access because of its use for spam and abuse. I believe this is more about user data than code. Obviously restricting public access to Git would be a different tier.