回购的所有者能看到克隆人吗?

我知道回购的所有者能够在执行分支请求时看到分支请求。那克隆人呢?回购的所有者能看到有人复制它吗?

118170 次浏览

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

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:

  1. Logged in as my main account
  2. Created a repository
  3. Set up a new dummy-account on an alternate email address
  4. Forked the repository I created earlier
  5. Logged back into my main account

This is what I see on my first page after logging in:

fork notification

If I do the following:

  1. Click on my repository

  2. Click on the small 1 to the right of the "Fork" button:

    fork button after forking

  3. Click on the "Members" tab:

    members tab

  4. Then I see this:

    content of members tab

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.

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

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!

Yes, it can be done.

  1. Go to your account landing page- https://github.com/yourusername
  2. Click on the repo you want to check traffic for.
  3. Click on Insights on top navigation bar.
  4. Click on Traffic on left navigation bar.

Voila, you will get your traffic including no of clones with a timeline.

Reference: clone graph

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:

enter image description here

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.

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