Pull request without forking?

GitGithubRepositoryBranch

Git Problem Overview


Here are steps of code contribution from the topic "https://stackoverflow.com/questions/4384776/how-do-i-contribute-to-others-code-in-github"

  1. Fork the project
  2. Make one or more well commented and clean commits to the repository. You can make a new branch here if you are modifying more than one part or feature.
  3. Perform a pull request in github's web interface.

Is it possible to make a pull request without forking a repo?

It's quite sad to see more than 20 repos in my account which were forked for some pull requests. They have no activity then and zero stars / followers. Looks like I'm just copying somebody's code for a black day.

Git Solutions


Solution 1 - Git

If you don't have access to create branches on that repository, there is no way to create a pull request without forking.

Solution 2 - Git

Once your pull requests are accepted, you can safely delete the repo.

Afterwards, simply clone directly from the original upstream repo.

If you have other pull requests to make, then you should make them in their own respective branch, which means you can safely delete the branch you made to manage an accepted pull request (as in "My pull request has been merged, what to do next?")

Solution 3 - Git

By definition, a pull request involves a fork unless you have commit access to the destination repository. You can do a couple of things, though:

  1. If you do have commit access, create a branch and make your pull request against the new branch.
  2. Post your patch in the body of an issue. This isn't really the GitHub way, but it certainly works.
  3. Fork a repository, create a pull request, and then delete the fork once the pull request is merged or declined.

If you're just trying to avoid keeping repositories around that you aren't actively using, I personally suggest option #3. It sticks to the accepted GitHub workflow without cluttering up your dashboard.

Solution 4 - Git

github supports Shared Repository Model

> The Shared Repository Model is more prevalent with small teams and organizations collaborating on private projects. Everyone is granted push access to a single shared repository and topic branches are used to isolate changes. > > 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.

Solution 5 - Git

You still need that one-liner: hub fork;git push -u $GIT_USER HEAD;hub pull-request

Solution 6 - Git

This is confusing. You can create pull request but you instead fork someone project then upload your own and in your fork make changes. Select options to compare branches. This is one of method. You should fork someone project and clone it using newest git gui (type url and name of folder, installation path will store your forks, default setting should be optimal for pasting). Alternatively use soulseek (which works like server), torrents or chomikuj (althrough you need use there dziellacz to split open source files to 1MB to merge).

Solution 7 - Git

As a workaround, you can create organization only for fork repos.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJasperView Question on Stackoverflow
Solution 1 - GitRyan BiggView Answer on Stackoverflow
Solution 2 - GitVonCView Answer on Stackoverflow
Solution 3 - GitTodd A. JacobsView Answer on Stackoverflow
Solution 4 - GitYa ZhuangView Answer on Stackoverflow
Solution 5 - GitAnona112View Answer on Stackoverflow
Solution 6 - GitAnonAView Answer on Stackoverflow
Solution 7 - GitmeetjaydeepView Answer on Stackoverflow