How can you save branches without PullRequest? #186478
Replies: 22 comments 3 replies
-
|
git checkout ur_branch ------------ flag this as answer was right i need it also if it didnt work lmk |
Beta Was this translation helpful? Give feedback.
-
|
like commit without pushing mate |
Beta Was this translation helpful? Give feedback.
-
|
this option, these are standard actions, and of course I tried it, but it leads to the same thing pullRequest |
Beta Was this translation helpful? Give feedback.
-
|
I don't need to merge the branches, but rather have them remain unmerged, and then merge them manually at the right moment... |
Beta Was this translation helpful? Give feedback.
-
|
ignore the pullrequest since its optional until you actually want to merge and simply keep them unmerged |
Beta Was this translation helpful? Give feedback.
-
|
This is true, for now this is the only way, but I would also like to know if this is somehow provided for in GitHub itself, if such options exist at all? |
Beta Was this translation helpful? Give feedback.
-
|
like I said its optional and github doesnt force you to pullRequest it take that button as a suggestion but there no settings for that as far as im informed!! |
Beta Was this translation helpful? Give feedback.
-
|
It's a shame this isn't available to repository owners. Perhaps one of the developers can suggest something. Thank you for your responses and participation. |
Beta Was this translation helpful? Give feedback.
-
|
no problem would help u further but thats it I guess it really sucks cuz I was also confused at first and its annoying, If you got your answer done would like u to flag this as answered unless not thank you and see you!! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks again for the replies. I'm not closing this yet, maybe the developers will have some advice. I'll wait a bit. Good luck. |
Beta Was this translation helpful? Give feedback.
-
|
hello, have you got any dev help? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Thank you, of course, but why did you post these instructions? Do you think no one is familiar with them? Or are the methods you described unknown? Also, could you please explain that a pull request can simply be closed, and then the branch won't be merged with the main branch? Everyone probably knows this. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
You can just ignore the notification for a PR and do it later like you want nothing is forcing you to create the PR right away. |
Beta Was this translation helpful? Give feedback.
-
|
If you’re working alone on a repository, you don’t need to use Pull Requests at all — they are mainly a collaboration and review tool, not a technical requirement of Git or GitHub. You can freely create multiple branches locally, push them to GitHub, and continue refining them by pushing more commits to the same branches over time. When GitHub shows a “Compare & pull request” prompt after you push a branch, it’s only a suggestion and can be safely ignored; the branch will remain separate until you choose to merge it. As a solo developer, you can merge branches directly into main/master locally using git merge and then push, without opening any PR. Pull Requests become mandatory only if branch protection rules are enabled in the repository settings (such as “require pull request before merging”), and since you are the repository owner, you can disable those rules if you want a simpler workflow. In short, just push and update your branches normally and merge when ready -no PR process is required unless you intentionally enforce it. |
Beta Was this translation helpful? Give feedback.
-
|
You don’t need to create a Pull Request in order to keep or refine branches on GitHub. Pull Requests are only required if you want to merge changes into another branch (like main/master) and go through a review process. If you are working alone and just want to save multiple branches, you can simply create them locally and push them to the remote repository. They will remain as independent branches in GitHub until you decide to merge or delete them. GitHub may suggest opening a Pull Request, but it is optional — you can safely ignore it. As the repository owner, you have full control: you can push, switch between, and update branches without merging them. They will stay available in the branch list of your repository, and you can continue refining them over time. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Well, rejecting the branch merge was clear from the start, and I'm doing it because there's no other way. This thread was created to find out if such a setting exists in GitHub. It seems there isn't, or maybe it's somewhere in the settings, but the developers haven't checked it, as far as I understand... |
Beta Was this translation helpful? Give feedback.
-
|
Hi, You don’t need to create a Pull Request if you’re working alone. GitHub only suggests creating a PR — it does not force you to. Here’s how it works: 1. You can push branches without mergingYou can freely create and push multiple branches: git checkout -b feature-1 They will just exist on the remote repository. No PR is required unless you want to merge into main. 2. Merge locally instead of using PRIf you don’t want to use Pull Requests, you can merge branches locally: git checkout main This completely bypasses PRs. 1. GitHub only prompts — it doesn’t enforceThe “Compare & pull request” banner is just a suggestion. 2. When PRs are actually requiredPRs are only mandatory if: Branch protection rules are enabled The repository requires PR reviews before merging If you’re the repository owner, you can check this under: If there are no protection rules, you can push and merge directly. So in short: You can push as many branches as you want You can merge locally PRs are optional unless branch protection is enabled Hope this clears it up 🙂 If this helps, feel free to mark it as the accepted answer. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks everyone, it's time to close this thread. I couldn't find out if there's a GitHub setting that would allow you to disable branch merging altogether, or even prevent the merge from being proposed. That was the question, and it was clear from the start that you can refuse the merge and close the merge PullRequest. Developers don't look into such topics... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
If a developer works alone, not in a team, and needs to push several branches to the repository and gradually refine them, how is this possible? If they create branches locally and then push them, GitHub will prompt them to merge pullRequest with the main/master branch. The same applies if they create branches in GitHub, then push them locally and refine them, and then push them to GitHub, which again prompts them to merge pullRequest. How can this be circumvented? Does the repository owner have such options?
Beta Was this translation helpful? Give feedback.
All reactions