move Git commits to new branch so I can change name of branch

Discussion in 'iOS Programming' started by patent10021, Mar 26, 2016.

  1. patent10021, Mar 26, 2016
    Last edited: Mar 26, 2016

    patent10021 macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #1
    I have 10 commits on a local branch1 used for new features that I want to move to a new local branch2 simply so I can use a more appropriate branch name because the branch1 name I'm using now is ambiguous. As mentioned the current local branch1 with the 10 commits is not the master so no problem there. All commits are local. Nothing pushed to remote yet.

    EDIT: Oh wow. You can simply click rename branch in GitHub for desktop. Or just
    git branch -m <newname>.

    So I've renamed the current local branch and done all my local commits. I'm ready to make a pull request but what should I do first?

    Should I first push to origin which is my GitHub repo (it's actually a fork of someone's project) or should I do the pull request first?
     
  2. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #2
    Checkout branch1 and then create a new branch branch2 at that point. Then keep using branch2. How is that not what you want?
     
  3. patent10021, Mar 28, 2016
    Last edited: Mar 28, 2016

    patent10021 thread starter macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #3
    I just renamed it in GitHub app or command line. Easy.


    I created the pull request. It's still open and the owner has created a new branch5 and wants me to point my same pull request to the new branch5.

    Do I just go back to GitHub desktop and submit a new pull request to the new branch5 or can I just change the destination of the previous pull request in some GitHub settings?

    btw, why doesn't he just pull it then merge it himself?

    Never mind. It was easy.
    http://stackoverflow.com/questions/...-github-to-change-target-branch-to-merge-into
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State

Share This Page