Issues if migrating a repository to a Github organisation then forking the repo? - github

I have a Github repository, lets call it:
http://github.com/LegoStormtroopr/ExampleRepository
I want to hand ownership of this repository over to an Organisation to get:
http://github.com/MyCoolOrg/ExampleRepository
But, I want to keep working on the code on my own fork. If I forked this code, I'd once again have a repository with the address:
http://github.com/LegoStormtroopr/ExampleRepository
In effect, I'd move the upstream to the organisation, make forks in a local github fork, and then be able to issue pull requests to the organisation.
I'd like to do this with the least hassle and breakages, and the documentation on what happens after a repository is handed over is a little hazy.
Are there any serious issues that will happen as a result of shifting the repository like this? Will things break because a repository that was there disappeared for a short time?

So having just given this a shot, it appears there are no issues when doing this. However a few things to note:
The organisation cannot have a previous fork of the repository. This prevents it from being able to take ownership.
If you transfer the repository to the organisation, and then fork this into your own account, any working copies of this don't need to be updated, however changes you make will be pushed into your repository, not the organisations.
You may need to reconfigure third-party applications (like Travis-CI and Coveralls) to work with the new organisation, but this is straight forward:
From your account, go to settings and select Applications:
Find the application you need to reconnect (for example Travis-CI) and click View:
Next to each orgnaisation there will be a button titled Grant (not shown because I've already clicked it):
To get Coveralls working properly, in addition to the above, you also need to:
Set your visibility in the organisation to Public:
Refresh the list of repositories in Coveralls (ignore the button name, it syncs public and private repositories):
Lastly, to retain your coverage history, in Coveralls in your old repository select "Change source" and in the list select the corresponding repository in your new organisation.
And now your organisation is all set!

Related

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 make sure no one forks my GitHub repo but still allow the work to be seen by recruiters?

I am now building portfolio to get my first tech job. I would like for any recruiters/potential employers to see my code in case they want to see how I am putting things together but I don't want anyone to be able to fork or copy my work.
How is this possible?
If I have a private GitHub repo does that mean that you can see the repo but just not the inner contents? I have looked at the GitHub documentation already.
If I have a private GitHub repo does that mean that you can see the repo but just not the inner contents?
If you can access a repository (public or private), that means you can read its content and/or clone it (and read its content locally)
You would need to setup a private repository dedicated to show your file
names, meaning a collection of files with:
dummy content
the exact names and folder structure than your actual projects.
That way, you can share to select collaborator access to that "showcase" repository, without compromising the sensitive content of your actual project repositories.

How to track all the upstream issues my fork addressed

My company wants to contribute on opensource projects and managers want an easy way to see which upstream issues were closed by forks from our organization.
Is there any way to maybe copy upstream issues to a fork or reference them in an easy way to track my organization contributions to a project?
This may be possible through GitHub Projects. Projects exist per the organization, not a particular repo. You can also link to issues and pull requests from repos of other organizations by entering user/repo#issue in the project's task description.
In the case of your scenario, suppose your team shares a GitHub organization. You can create project, then add items that reference your issues and pull requests, which exist within the open source project's repo. You can configure and organize your project's view(s) to display the information you want to show. Since this merely links to the issues/PRs from the open source repo, the original stays intact, and how they are displayed in your project stay in sync.

How do I get my code reviewed if I am owner of Github repository?

I have created a repository(of which I am the owner). My repository has about 5 contributors. We are able to review the code submitted by the contributors when they submit their pull request.
What I need to know is there a way other than me opening another account and becoming a contributor myself to get the changes I commit to the repository be reviewed by other contributors first before they are added to the repo.
Yes. If you always work in a different branch, then you can submit a pull request for merging that branch into master.
If you want all branches, and not just master, to be code reviewed, then you will need to work in a different repository. The best way to do this is usually not to open a new account that you make a contributor, but to make an organization for the main repository, transfer ownership to that, and make your main account a contributor. This is probably better for larger projects but may be overkill for smaller projects.
Either way, you can set the repository to protect the master branch and require code review for all commits by everybody (though since you’ll retain control over the repository, you can always bypass this by un-setting that first).

How can I make a second fork of a GitHub project?

I want to fork a github project to fix a couple of issues and then send a pull request.
The problem I'm running into is that I've already forked the project to adapt it for another user base.
Is it possible to create a second fork? If so, how?
When I try to fork now it just takes me to the previously created fork.
There is no way to have two forks of the same GitHub project unless you use two different GitHub accounts.
So:
Create a separate GitHub account (and verify the email)
Fork the
project
Invite your main GitHub account as a "Collaborator" (from
the settings)
You may need to add the extra step of creating an organization with the new GitHub account and inviting your main github account as an owner of the organization (also make sure your new fork is in that new organization). This will let you do things like deploy automatically to a Heroku app that is connected to your main GitHub account.
Why can't we just have multiple forks???
I mean that I could just commit and push without making a pull request, but I want to do it the offical way and I want somebody else to review the changes before I push to a public project.
GitHub pull requests do not need to be submitted from a fork; they work within a single repository as well:
Pull requests are especially useful in the fork & pull model because they provide a way to notify project maintainers about changes in your fork. However, they're also useful in the shared repository model where they're used to initiate code review and general discussion about a set of changes before being merged into a mainline branch.
There's nothing stopping you from creating a pull request even if you don't technically have to. This is often considered a best practice, and GitHub's own Flow model is largely based on pull requests.
Creating a pull request within a single repository is very similar to creating one from a fork:
Create a feature branch and push your work to that branch on GitHub
In the GitHub web UI, switch to your feature branch
Click the "Compare" & review button
The trick is not to use the master branch to create pull requests. Then you won't need to create multiple forks since you can make as many branches as you need and make pull requests against each branch independently.
Given a clean forked repo, create a dedicated branch and use that branch for the pull request.
You can create branches from the web UI (although it is not obvious).
Click the branch selection dropdown, type the new branch name in the input field, and then you'll see a clickable link Create branch: <new-branch-name> as shown below. The tricky UI part is that it might not be very obvious you should click the "create branch: xyz..." — it is NOT displayed as a button or as a hyperlink, and there is NO indication that this is a clickable link. Moreover, there is NO hint whatsoever that a branch can be created until you type in the search box — anyone would probably assume that the search box is used exclusively for searching branches, and not for creating them.
In case you already made changes directly in your fork's master branch then consider moving those changes into a dedicated branch and hard resetting the master branch to the original remote so that you keep it clean for synching with the upstream repo.
See also:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository
The best way, recommended by github manual, is use command line git, mirror clone your repo and push it to your github.
https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/duplicating-a-repository
If you strongly prefer GitHub web interface to the command line, a GUI friendly workaround is create a new organization and fork to that new organization.
Another GUI way I can think of is to declare a fork as a template repo using repo's setting so you can create as many forks as you need.