Renaming a branch while on pull request

Michele

On Github, you can make pull requests to add functionality to a project. One's contributions have to be on a branch that, if the request is accepted, will be merged into the master branch (or an analogous one) of the project.

Now, I submitted a pull request on Github and my contributions are on a branch called patch-1. I can modify the name of the branch locally by

git branch -m patch-1 newname

and in principle I can also rename it on my forked repo on Github by following the instruction found in this answer. This is done in practice by removing the old branch, patch-1 in my case, and repush it with a different name newname.

Is it allowed to rename the branch patch-1 on my forked repository on Github when it constitutes a pull request? Or it causes problems on the pull request management?

Is there any way to rename a branch on a forked repository on Github when that branch is a pull request?

arbylee

"Renaming" a remote branch in git, as indicated by the link you provided, is really just deleting a branch, followed by pushing a new one with the same commit hash but a new name. If you have a pull request open for branch patch-1, when you delete that branch, the pull request will be closed.

So, no you can't rename the branch with a pull request open without deleting the branch and removing the pull request. However, there's nothing stopping you from doing that, pushing a new branch with a new name, and creating a new pull request.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Pushing to Pull Request Branch on GitHub

From Dev

Using "pull request" to request a merge on a branch

From Dev

What's the difference between a Pull Request and a branch?

From Dev

git branch cleanup with squash for a pull request

From Dev

Cherry-pick a pull request into a branch?

From Dev

How to get JIRA issue for branch/pull request?

From Dev

Git: "This branch is behind" after pull request

From Dev

git commit and push to branch but not to pull request

From Dev

What's the difference between a Pull Request and a branch?

From Dev

Possible pull request workflow to merge a branch into master

From Dev

github pull request from a single branch

From Dev

GitHub: Pull Requests: do I have to branch after a pull request?

From Dev

How to create a branch on tip of branch and create a separate pull request for it?

From Dev

Getting git pull request while push

From Dev

Github working on fork while waiting for pull request

From Dev

Renaming branch possible?

From Dev

Renaming branch possible?

From Dev

How to make automatic pull request with Sourcetree NOT in master branch?

From Dev

git, is it possible to send pull request from master branch?

From Dev

git request-pull from local branch to remote master

From Dev

Bitbucket: Enforce merge-only by pull request on branch workflow

From Dev

What happens if you force push to a branch with an existing pull request?

From Dev

Jenkins GitHub pull request builder - get branch name for execute shell

From Dev

Merge latest and pending pull request with new branch on Git repo

From Dev

Add commits to a merged branch and start a new pull request

From Dev

Rebase a pull-request already merged in my local develop branch

From Dev

Git revert cherry pick on pull request branch without reverting on master

From Dev

Close issue on GitHub pull request to non master branch

From Dev

How to check if a pull request is merged in some branch of the target repository?

Related Related

  1. 1

    Pushing to Pull Request Branch on GitHub

  2. 2

    Using "pull request" to request a merge on a branch

  3. 3

    What's the difference between a Pull Request and a branch?

  4. 4

    git branch cleanup with squash for a pull request

  5. 5

    Cherry-pick a pull request into a branch?

  6. 6

    How to get JIRA issue for branch/pull request?

  7. 7

    Git: "This branch is behind" after pull request

  8. 8

    git commit and push to branch but not to pull request

  9. 9

    What's the difference between a Pull Request and a branch?

  10. 10

    Possible pull request workflow to merge a branch into master

  11. 11

    github pull request from a single branch

  12. 12

    GitHub: Pull Requests: do I have to branch after a pull request?

  13. 13

    How to create a branch on tip of branch and create a separate pull request for it?

  14. 14

    Getting git pull request while push

  15. 15

    Github working on fork while waiting for pull request

  16. 16

    Renaming branch possible?

  17. 17

    Renaming branch possible?

  18. 18

    How to make automatic pull request with Sourcetree NOT in master branch?

  19. 19

    git, is it possible to send pull request from master branch?

  20. 20

    git request-pull from local branch to remote master

  21. 21

    Bitbucket: Enforce merge-only by pull request on branch workflow

  22. 22

    What happens if you force push to a branch with an existing pull request?

  23. 23

    Jenkins GitHub pull request builder - get branch name for execute shell

  24. 24

    Merge latest and pending pull request with new branch on Git repo

  25. 25

    Add commits to a merged branch and start a new pull request

  26. 26

    Rebase a pull-request already merged in my local develop branch

  27. 27

    Git revert cherry pick on pull request branch without reverting on master

  28. 28

    Close issue on GitHub pull request to non master branch

  29. 29

    How to check if a pull request is merged in some branch of the target repository?

HotTag

Archive