How to check which person clone my project in github - github

I have my projects on github, and they're public. How would I know that my projects have been cloned, and by whom?

There is now way of telling who have cloned your project.
But, Github provides basic statistics about visitors and clones in 'Graphs' option on your repository. Here is a link.
Also you can see who has forked your project:
A number showed on top right corner on your repo present on Github.
Go to Graphs->Members to check out who forked your repo.
Hope this helps.

Related

GitHub: pulling and pushing project with my collaborator

I'm working on a project created by a friend. He created his project on Intellij and connected it to a Repository on GitHub. Committing and pushing works, but i (a collaborator) don't understand how i can pull the project from git, and doing merges/pushing/committing. Any help? I've watched plenty of tutorials, but everyone only address the problem of connecting a project to github.
Are you able to clone the project?
Make sure you are actually under the collaborators and you can access it trough Github.
Then clone, steps here.
After making changes go to the "VCS"->"Git"->"Commit", then "Push"
Then go to "VCS"->"Git"->"Merge Changes"
Select the branch you want to merge from
Resolve any conflicts and merge.

Original repository issues on forked repository

I intend to work on an open-source project, I followed the below steps to start contributing according to this instruction:
1- Fork the repository
2- Clone your fork of the repo from your GitHub account to my local disk
3- Install the development dependencies
4- Add the upstream remote.
5- Synchronize my main branch with the upstream/main branch
6- Create a feature branch to hold my development changes.
After doing these steps the issues that are defined in the main repository hasn't been shown in the forked repository. The issues in the main repository are several thousand but the forked repository shows zero. I followed the answer for this SO question. But it didn't work for me.
Question:
My question is how can I have all issues and also pull requests of the original repository in the forked repository?
Updates:
According to this answer, installing GitKrake and then cloning the forked repo and selecting GitHub as the issue tracker for the selected repo should solve the problem. I installed GITKrake and forked repo but the issue didn't be shown.
New Question:
Is there any way to see the issues without any other tools and directly on Github?
Can anyone give more detailed instruction on using GitKrake for seeing the issues of main repository on forked repository?
There is no way to show all the issues of the main repo on your repo.

Un-fork GitHub project into new GitHub project not associated with the original [duplicate]

How can I make GitHub forget or disassociate that my repo was originally a fork of another project?
I forked a project in GitHub. I can now see "forked from whatever/whatever". The parent repository "whatever/whatever" is no longer maintained. I have been allowed to continue use of the code base of the original repository to create an independent repository.
Is there a way to detach my project from the original repository?
Update Jan 2022:
Use the GitHub chatbot-virtual-assistant at https://support.github.com/contact?tags=rr-forks&subject=Detach%20Fork&flow=detach_fork
First answer:
You can contact github support and ask them to switch your repository to "normal mode".
On this page, "Commit was made in a fork" paragraph, it is explained that one has to go through support to switch. Therefore, it is likely that there is no way to do that by yourself (unless you destroy and recreate your repo which is explained before... if you do so be careful if you have tickets or a wiki attached to your project as they will be deleted!).
You could duplicate the forked repository to a new repository (without the fork dependency) from the GitHub UI, then remove the original forked one:
Sign in to GitHub
Select the + sign in the top right corner and select Import repository.
Import your forked repository. The new repository won't have the fork dependency.
Delete the original, forked repository in the repository settings.
NOTE: This approach will not preserve issues and pull requests.
Make sure you have all the important branches and tags on your local repo, delete the github repo, recreate the repository through usual means (no forking) and push the local repository back with git push --all. Note that if you have local branches that you don't want to publish, might be worth to create a temporary clean local clone for the operation.
However, this will also get rid of wiki and issues. As the wiki is in fact it's own repository, it can be handled similarly by cloning it and then recreating and pushing. The repo address is on wiki's Git Access page (git#github.com:user/repo.wiki.git).
This leaves issues. They can be exported through the API, but as far as I know, you can only create issues and comments with your person, so importing them perfectly is impossible.
So, if you need issues to be preserved, you should go through github support as Thomas Moulard suggests.
I got the similar problem, and ended up using this github help page to solve it. I didn't mind about the wiki and issues tracker as it was for my blog using a theme kindly developed by another user.
To detach a forked repo and use it as your own after several commits without losing the whole history:
git clone --bare git#github.com:user/forked_repo.git
Create a new empty reposity new-repository on the github website.
And push a mirrored version:
cd user.github.com.git/
git push --mirror git#github.com:user/new-repository.git
One can rename on github, the forked_repository with another name to keep it as backup and check updates if needed. Or simply delete it.
Renaming the new-repository to the original name does the job. As a side effect, your commits now appear in your history.
Log in to GitHub with your credentials.
Go to https://support.github.com/contact?tags=rr-forks&subject=Detach%20Fork&flow=detach_fork.
Choose "Detach", then enter the URL or repo name of the fork as your-user-name/repository-name, and answer the other questions of the virtual assistant.
You will get an email with a ticket number where you can check the status of your request. You will also be notified per email once your repo has been deforked.
Most repository settings will stay unchanged, including user permissions, stargazers, issues, PRs, discussions, etc.
Using the info from aurelien and Clayton, I was able to do this with the following:
$ git clone --bare https://github.com/my/forked_repo.git
<delete forked_repo on GitHub>
<recreate repo on GitHub using same name>
$ cd forked_repo.git
$ git push --mirror
Here's the documentation for git clone --bare:
Make a bare Git repository. That is, instead of creating <directory> and placing the administrative files in <directory>/.git, make the <directory> itself the $GIT_DIR. This obviously implies the -n because there is nowhere to check out the working tree. Also the branch heads at the remote are copied directly to corresponding local branch heads, without mapping them to refs/remotes/origin/. When this option is used, neither remote-tracking branches nor the related configuration variables are created.
Here's the documentation for git push --mirror:
Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end. This is the default if the configuration option remote.<remote>.mirror is set.
Note: like the other git based answers, this will not copy over issues that are not part of the git repo such as the wiki and issues. Per Tapio:
The wiki is a separate git repo and can be handled in a similar fashion per Tapio. The address is: git#github.com:user/repo.wiki.git.
Issues can be exported via the GitHub API but there are issues recreating them since they can only be created by your user, so imports will lose information.
This only applies to GitHub Enterprise, not on github.com
Logged in to an account that has admin privileges:
Go to the repository that you need to detach: https://<ghe url>/<org>/<repo>
Click on the “Site Admin” rocket on the top right corner
Click "Collaboration" on the top menu bar
Click on “Network” on the left pane
Click on “Make Root” in the Network Structure pane
Accept
This was tested on GitHub Enterprise 2.9
If you do not need any past commits (I didn't in my case), you can just:
fork the project
make a local copy of the fork (I used my IDE to do that)
delete the git folder from your local copy
commit the project as you normally would a new project.
You can just delete the fork from your github account after. Took me all of one minute and worked like a charm.

Complete contribution to git repo

I want to contribute to a git repository. From the tutorials and other things what i found is i have to fork the repository to achieve this. So i forked the repository and then i cloned my copy of code in SourceTree.
Now in the repository property i changed the user name to the owner of that repository in the optional extended integration section.
Then i changed the code where needed and pushed to master branch. Currently its showing that i made contribution in my repository but i want those changes to reflect in the main repo.
Can anyone guide me how can i do this.
You need to issue a pull request then.
As long as the core developer (team) has not added you as a contributor and granted writing rights on the repository, there's no way you can contribute directly. Your only option then is to work on your own fork and hope the developers have and take the time to review and incorporate your pull requests.

Correct process to merge fork changes into GitHub

I am new to GitHub. I don't know the correct process to merge my changes with the upstream. I followed following steps using EGit (I like to use it because I find it simple). Please help me.
On GitHub I created a fork.
For my fork I cloned a repository in Eclipse and imported respective projects.
In remotes, I added one more for the main project say Upstream(from where I forked) on GitHub.
I added some changes into my local repository.
How can I do the following part? -
Now in the meantime other people added some changes to the upstream. Now I want to integrate my changes(in the fork I created) to the latest changes(upstream) using EGit and push it to my repository and send a pull request.
Please help me.
create another remote corresponding to your fork in Eclipse
publish (push) your changes into your fork repo on github
create a merge request from the web interface in the original github repo, pointing to your changes on github
There is the procedure, how I do it.
GitHub browser UI
delete your fork with too much mess, if exists - this is in your Settings -> Danger Zone, the button is in upper menu bar in the root of fork
fork for you a new one on the foreign page, where I have access
open newly created fork and copy URI to the clipboard
Git perspective in Eclipse
create clone of your fork in my GUI Eclipse
Create a new branch in local branches and activate it
Import project from working tree in Eclipse as general project from Git perspective to actual workspace
do changes, integrate your important files to the general project (add to index etc.)
commit, push
GitHub browser UI
create Pull request from your fork directly from actual branch (recommended) or after merge in master branch
Notice, that in the picture is merge branch selected. In our real case is better to use the name, which is more descriptive.