Can the owner of a repo see clones? - github

I know that the owner of a repo is able to see a fork request when one is performed. But what about a clone? Can the owner of the repo see when someone clones it?

The question is too general, but let me answer the question as it stands now.
Can the owner of the repo see when someone clones it?
No, they cannot. If I go to one of your repositories and clone it to my local hard drive, the owner will not be able to view that activity. And why would you want to? Likely there are many clones of your repository.
Know that clones can live on other systems than GitHub.
Now, will the owner know that someone forked their repository on GitHub itself?
Yes, they will, assuming they pay attention.
I did the following:
Logged in as my main account
Created a repository
Set up a new dummy-account on an alternate email address
Forked the repository I created earlier
Logged back into my main account
This is what I see on my first page after logging in:
If I do the following:
Click on my repository
Click on the small 1 to the right of the "Fork" button:
Click on the "Members" tab:
Then I see this:
Conclusion:
Yes, the owner of a repository will see when someone makes a fork on GitHub, but no, they will not see it when someone makes a clone somewhere else.

As far what I found you CAN'T know when someone clones it (if you mean exact time) nor who cloned it.
But you can know how many clones were made on which date and the number of unique cloners from ths url.
https://github.com/{usernamme}/{reponame}/graphs/traffic
Insights tab:
However one thing I find fishy is unique cloners is more than unique visitors, how can someone decide to clone even without visiting the repo. I guess it may be bots in such cases.

You can use clone graph on GitHub to find out how many times your repository's source code is actually cloned in a given day. More information can be found here https://help.github.com/articles/about-repository-graphs/#traffic

Yes, it can be done.
Go to your account landing page- https://github.com/yourusername
Click on the repo you want to check traffic for.
Click on Insights on top navigation bar.
Click on Traffic on left navigation bar.
Voila, you will get your traffic including no of clones with a timeline.
Reference: clone graph

Open Github, find your repo, click on it. Then click on Insights and finally click on Traffic. Github shows a graph Traffic including git clones. Salutes!

As for now we can obtain this information with Rest API /audit-log,
but it is available only for Enterprise users with org:read permission.
We can see the actual users that have preformed fetch, clone and many more actions.
https://docs.github.com/en/rest/reference/orgs#get-the-audit-log-for-an-organization

as long as you have access to the repo, aka an ssh key on the filesystem with the remote, then yes. you would do as follows:
git fetch some_remote
git log some_remote/some_branch

Related

how to allow 3rd party to create repo (repo transfer) in our Org without let them see our private repo?

We have hired a 3rd party to work on a project, we started by not creating any Repo on our Github, but they started with their Repo. So now it's time to transfer the repo. However, in order to transfer the repo, the developer is asking permission to create a Repo in our Org... but as far as I know, I can only invite him first as a collaborator, a member, before he can create any private repo in our Org... that means he can see our other repo...
I couldn't find any good answer online, please help. Thanks!
Have you tried using Github's Organization features? You can create an organization with your team members in it, and control who has access to what.
Here's a Github page that explains a bit more about how it works.
Do not add them as a member to your Org! (this is the only option today from Github, nor owners...of course). If you do so, this will give your external developer access to all of your repos.
The only way I found you can safely invite an external user is to create a Repo first, then add them in that Repo. By doing that, they will be invited only to that repo, and have no access to the others.
This is my workaround. If you have a better solution, please do comment. I am curious how the "transfer" feature works.

Show commits and description but hide code in repository [Github]

I've almost done my first big project in React+Typescript+Redux and started it on Firebase with users and some database conneted with logged users.
It was supposed to be my project to portfolio before looking for my first dev job, but it start to be very complex.
Now I have idea to use it in the future to make commercial app.
So the problem is I don't want to publish my code on github, but at the same time I want to publish all my commits and repository description on Github for recrutiers (and all my tasks from trello table). Is it possible to publish only commits and description from github repository?
No, this is not possible. If your repository is public, anyone can clone the entire repository. The only way to make your code inaccessible is to make the repository private, which means nobody can see it without having permssion.

Can I have GitHub automatically redirect from GitHub repo view to GitHub Pages?

In a recent publication, I included a link to the GitHub repository for the code.
https://github.com/martinkrz/posepi1
This link is now in the literature, so I cannot easily change it. I'm wondering whether there's some way to have requests to the repo page (I can't find anything on this) be automatically forwarded to the GitHub Page for the project, which is at
https://martinkrz.github.io/posepi1/
Again, I need a redirect by GitHub.com because I'm practically stuck with the https://github.com/martinkrz/posepi1 link in the published literature.
No, this isn't possible. If it were, it wouldn't be possible for anyone to view the repository's overview page anymore, which would make doing common tasks difficult.
You could try updating your repository README to point to the place you'd like people to go, but that's the extent of the changes you can make.
This is not possible. You cannot (and to be honest nobody should) change or create self-executing code on your GitHub repository.
And thus, you cannot redirect users.
But you can put the GitHub Pages link into the description of the repository and/or add it as a link in the README.md
The link could be
Click here to see the code in action!
or something like that

How can my GitHub repo have 1 visitor but 12 clones?

This has baffled me for quite a long time.
I notice that anyone with a link can download the repository. But the question is, where do they get the link from? I cannot seem to find a page on GitHub listing all the newly published repo.
Everytime I publish a new repo, there would be 3~6 mysterious clones follow shortly after, even when the number of visitor remains at most 2 persons.
While I welcome people to find out what my code can do, it somehow gives a pressure on me not to publish unfinalized code, and also not to amend the content of my repo after publishing it because they might already have cloned it before the changes are made.
Alright, it has 2 visitors (including me) to be exact:
You have no way to see who has checked out your repository using standard git commands such as git clone, but you can see who has forked your repository on GitHub in the Traffic section under Insights.
Now my first thought would be that those people cloned your repository outside of Github as you don't need to be a Github user to clone repository (so Github couldn't keep track of them and you wouldn't be able to see them).
Good luck, hope this helps.

How can I tell who forked my repository on GitHub?

Is there a way to know who has forked my repository on GitHub? I can see the number of forks, but I'd like to know who forked my repository and what kind of changes they made to it.
I know they can send me a pull request if they're interested in contributing back to my repository, but is there some other way for me to find out who forked my repository?
Clicking the number of forks shows you the full network. From there you can click "members" to see who forked the repo. Example for ExpressJS: https://github.com/expressjs/express/network/members.
now you can check the forks in Insights -> Forks
One way I discovered from the browser is attempting to create a pull request and then compare across forks. All the existing forks would show up.
The accepted answer above helps to see the accounts who forked the repository. In order to meet the other requirement, i.e. see what kind of changes have been made you will need to go to each individual forked repository and then see the compare tab (please refer to the attached picture). To see exact details on what files have been actually changed you should click on the compare button shown in the image.
The above process is the right way and can be tedious. In case you want to see the summarized information of how ahead or behind is each forked repository you may use the link https://forkinfo.herokuapp.com/, which I have open sourced here in case you want to edit it as per any specific requirements. It fetches information about how much a fork is ahead or behind the parent fork, by getting that information from homepage of each forked repository (from the part highlighted in the image). This information is generated based on comparison of repositories