Github - Fork a private repo - github

I have been added to an organization that has some private repositories and I need to send them a pull request with some changes but I don't know if I can.
I haven't a paid account on GitHub, so how can I fork that private repo to modify and send pull requests?

As mentioned in "If I fork someone else's private Github repo into my account, is it going to appear in my account as a public repo?", you can fork a private repo (for which you were added as a private user). The resulting repo will still be private, and you will be able to make pull-requests.

You can make a pull request from a branch in the private repository without the need to fork it.
The workflow we are starting to use is:
1. clone the private repository
2. make a branch
3. work on the branch
4. push the branch to the private repository
5. goto GitHub and create a pull request from the branch on the private repository
6. someone else reviews the the pull request and decides to merge it with master on GitHub
7. delete the branch unless there was a problem and it was not merged then go back to #3

I was having a problem when trying to clone a repository that i was added to contribute, it was a private repository so i did these steps.
clone the private repository using ssh (important it was not working when cloning through HTTPS).
Create a new branch.
Do the changes to the code
Add, commit the changes and push the code to the branch you created.
Go-to GitHub and go to the private repository you will se a option on top to create a pull request, just click on that and follow the steps to add description to your pull request.
someone else reviews the the pull request and decides to merge it with master on GitHub
Then if the branch was merged you can delete the branch if not make the necessary changes and push the changes again and create a pull request.

Related

Create a pull request from a repository that is not a fork on github

forking iss not allowed (for this repository on github). So what I did was I cloned the repository to my local folder, Then made my changes and did a commit. then pushed it into my own repository on github.
Problem, my repository is not denoted as a fork in github. So there is no way to create a pull request to the original repository.
How do I set my upstream in github?
I tried to set upstream using git remote add, and create a pull request using git request-pull. But while the commands were successful, nothing showed up in github... my repository still does not show as a fork
when I try to create a pull request from the website, pushing "new pull request" button, I only see the same branch, I do not see my own fork even when choosing "across forks"
You cannot create a pull request from a repository that is not a fork. On GitHub, all the forks, plus the main repository, form a repository network, which shares objects. This is a requirement in order to create a pull request.
If you have push access to the original repository, then you can push your branch there and create a pull request from there. If you don't and the repository owner has prohibited forking, then you'll need to talk with them about how to get your change proposed.

How would I create a fork and create a PR for a local repository?

We are providing a code drop to our customer via GitHub and unable to fork and create a PR.
Locally, we developed some code, with a long commit history. Now, our customer is asking us to provide the code to him.
As far as I understand, the standard practice is that the customer would create a repo, I'd fork it, populate with our local commits and create PR to the customer, so he could review and accept our work.
This is where the problems start:
If the customer creates the repository populated with README, I fork it successfully but I'm unable to create a PR because of the different commit history.
If the customer creates an empty (without the README.md) repo, GitHub doesn't allow me to fork this empty repo.
How would I pass the repository to the customer, so he would be able to review, comment and accept our work?
One possible workaround would be for you to:
fork the client's repo (with a README)
fetch that fork (small) history, declared as "client"
git remote add client https://github.com/client/repo
git fetch client
rebase your working branch on that imported fork
git switch yourBranch
git rebase client/master
git push --force
make your PR.
That would mean for you and your colleagues the need to reset yourBranch to the new history created by the rebase.

Pull request not appearing in upstream repository

A colleague of mine forked my GitHub repository, and he adds his modifications. However, when he makes a pull request, it is not reported to my repository: the list of open pull requests is still empty.
In order to apply his modifications on my work, I must go to his repository and apply the pull request myself
Unless I misunderstood the pull request concept, do you a have a solution on this? Should I recreate my repository?
I must inform you that repository was a private one before I made it public.
Your colleague should create a pull request that targets your repository. The easiest way to do this is to navigate to your repository and create the pull request from there:
Confirm that the base fork is the repository you'd like to merge changes into. Use the base branch drop-down menu to select the branch of the upstream repository you'd like to merge changes into.
If the pull request is created properly, targeting your repository, you should see it in your list of pull requests.

Can I request github to delete an existing fork of my private repo?

I made a repo just now and commit the first version. This repo should be made private. During the time when finishing payment and changing from public to private, someone has forked this repo.
I read the introduction of github, it says If I change a public repo to a private one, the existing forks will be kept in a separate network, it means it will still exists.
So I want to know, can I request github workers to delete this existing fork? I must keep this repo private, it has some confidential information. I think github worker should help to make it.
You can, but any local clone of that fork can then be pushed again to a new non-forked repository. Created on GitHub or elsewhere.
So it really depends on when that fork was created: if it was after you started to put confidential information, said sensitive data are not safe (ie could be made public again) even if the fork were to be deleted.

How do I make a pull request using EGit?

I have a local master branch and I want to create a pull request with a repo owned by somebody else. When I attempt to "push branch", I get the following text: "can't connect to any URL: https://github.com/jleclanche/fireplace: git-receive-pack not permitted"
I'm guessing that what I'm doing here is actually trying to merge, rather than making a request. How would I do this?
These are the steps necessary to fork a repository, make changes and finally open a pull request to have the changes merged back into the originating repository.
On GitHub, navigate to the repository's page and click the Fork button in the top-right corner of the page
Copy the URL of the forked repository to create a local clone in EGit
I recommend creating a new branch in the form your-name/issue-name. Working on a separate branch gives a better oversight and helps when working on multiple pull requests in parallel.
Make one or more commits that should end up in a pull request.
Push these changes to the forked repository.
On GitHub, navigate to the fork's page. You should see a message there indicating that a new branch was created and a button to create a pull request. Click this button. On the next page, you can provide more information and finally confirm the creation of the pull request.
In order to consume changes made to the originating repository, you would want to add it as a remote to your local clone.
You may even want to rename the remotes, so that the forked repository (the one you are pushing to) is named fork and for the originating repository use the default name origin.
For example:
[remote "fork"]
url = git#github.com:your-name/forked-repo.git
fetch = +refs/heads/*:refs/remotes/fork/*
[remote "origin"]
url = git#github.com:user/originating-repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
In this answer, I assume that you have commit rights on the project in question, but still want to create a pull request. In this case, it's not necessary to fork the repository.
Create a local branch in Eclipse (Team -> Switch to -> New branch..., use the default values) and work on it. Eventually, push the branch to the GitHub repository.
Go to the repository on github.com.
GitHub will usually recognize that you have pushed a branch and offers the
option to create a pull request directly. Alternatively, you should be able to create a pull request from the "pull requests" tab.
If From Eclipse you commit the changes but due to conflict you cant get the Pull Request so do following steps to get pull req from git bash command
git status
git checkout develop-robot
git log [check your commit present or not]
git pull
git checkout
git rebase develop-robot
git push -u -f origin