Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 380
Daniel Paczuski Bak Avatar asked Dec 24 '22 06:12

Daniel Paczuski Bak


2 Answers

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.

  1. On GitHub, navigate to the repository's page and click the Fork button in the top-right corner of the page

  2. Copy the URL of the forked repository to create a local clone in EGit

  3. 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.

  4. Make one or more commits that should end up in a pull request.

  5. Push these changes to the forked repository.

  6. 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 = [email protected]:your-name/forked-repo.git
  fetch = +refs/heads/*:refs/remotes/fork/*
[remote "origin"]
  url = [email protected]:user/originating-repo.git
  fetch = +refs/heads/*:refs/remotes/origin/*
like image 82
Rüdiger Herrmann Avatar answered Dec 31 '22 08:12

Rüdiger Herrmann


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.

  1. 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.
  2. Go to the repository on github.com.
  3. 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.
like image 45
lighthouse keeper Avatar answered Dec 31 '22 08:12

lighthouse keeper