Original repository issues on forked repository - github

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.

Related

copy issues on fork repo to original repo

I want to see the issues I have made on forked repo on the original repo.
I did some experiment: I made some issues on my fork repo and was trying to see them on my original repo by merging through pull & request.
However, all I did was just merging a file only.
I was not able to see the issues on the original repo.
I was trying to do some research about it but hard to get some info related to the issues on the forked repo.
How can I add the issues I have made from forked repo to the main (original) repository?
You can transfer an issue from one repository to the other
And you can automate the process using the GitHuh CLI command gh issue transfer
However that means those issues are moved, no longer visible on their original fork repository.
Duplicating them or seeing them from the main repository is asked since July 2021, but not yet implemented.

Is it possible to fork github repo with original issues?

This probably sounds weird but I would like to fork someone's repo with all the issues attached to it. I know I can fetch changes from the original(upstream) repo such as added files or changed files but I would like to sync issues from the original repo with my repo.
I tried to sync my fork with the upstream but I see that changes in Issues (upstream) are not reflected in my repo.
If that's not possible directly, is there a workaround?
Update 1: So far, as a workaround I found this tool which allows to clone (not fork) issues to your repo. Functionality is limited, but it works https://github.com/gatewayapps/kamino
Update 2: A few more details to clarify my question. I want to be able to:
Fetch changes regularly from upstream repo.
Edit GitHub issues (create new issues, add comments, label issues, add labels) without affecting upstream repo issues.
Merge upstream issues and my issues/edits.
GitKraken can do this for you out of the box by just cloning the forked repo and selecting GitHub as the issue tracker for the selected repo.
All issues will then appear on the sidebar.

Cloned and Pushed a Forked Repo Successfully, Which Does NOT Read on Github

Using git bash, Windows 10 64x.
Successfully forked a repo, and cloned it to mine.
Was able to read it on my computer.
Also, there was no technical issue in pushing the repo (to my repo, not as an upstream) - can't click on 'datasharing'.
But I cannot read it on GitHub, and can't figure out why.
Please help me.
datasharing seems to be a submodule there. This means the original ower of the repo is using code from a foreign repo in his project. In order for you to use this code in a cloned repo you will have to obtain it separately after cloning your main repo. Imagine this like cloning a repo into a repo. This method is often used and perfect for referencing to external code while keeping all the advantages of version management rather than copying a static version of a library into your project.
Obtain the external code as follows:
Clone your repo as usual and cd into the folder.
git submodule init
git submodule update
The external code will be integrated into your repo and pushed/pulled with it. Not being able to click that folder seems to me as if github is aware of its existence but lacks the content.
For an exact reference on this topic you may want to read up on submodules in the docu found here.

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.

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.