How to push only to a branch of my fork of a Github repo, after a pull request has already been made

Say I cloned a public Github repo, called REPO. I then made a branch, did some work, and submitted a work-in-progress pull request to REPO. Whenever I push a new commit, it goes to both my clone, and REPO. This kicks off time consuming CI tests on REPO.

I switch between working on two computers, and it would be nice to commit to my clone of the repo, without adding it to the current PR on REPO. Then I could push, switch computers, and pull from the branch on my fork. When I’m ready, I can push a batch of commits to the pull request on REPO.

  • Using GitHub for mac with an old Xcode project
  • Where does it make sense to branch from when basically rewriting the codebase, if at all?
  • Git slow when cloning to Samba shares
  • How do I exclude a set of files from a local git repository?
  • How can I integrate git and svn for TeamCity?
  • Switch branches without losing uncommitted work
  • What is the best way to do this?

  • Is there any git repository with official daily updated Gentoo portage?
  • How to compare two source trees for differences/changes on win32?
  • Why does my 'git branch' have no master?
  • xCode 4.5 git merge fails to commit or give errors
  • Why is git hanging - have to press enter twice after commands?
  • Migration from UCM ClearCase to GIT
  • One Solution collect form web for “How to push only to a branch of my fork of a Github repo, after a pull request has already been made”

    Create a new branch (say, feature) from the branch you created pull request (say, pr-branch).

    $ git checkout pr-branch       # checkout to 'pr-branch'
    $ git checkout -b feature      # create and checkout to 'feature' branch

    Then, when you are done with feature branch, merge the feature branch with the pr-branch.

    $ git push origin feature      # push 'feature' branch changes to remote
    $ git checkout pr-branch       # checkout to 'pr-branch'  
    $ git pull origin feature      # pull 'feature' branch changes into local 'pr-branch'
    $ git push origin pr-branch    # update remote 'pr-branch' 

    Now, your PR on REPO should be updated automatically since pr-branch is updated with feature branch commits/changes.

    If you have to switch between two computers and work on feature branch then, just push your latest feature branch changes to remote and pull from another computer to start working from latest codes.

    # computer-1
    $ git pull origin feature
    # do some commits here...
    $ git push origin feature
    # computer-2
    $ git pull origin feature
    # start working from latest codes and do commit...
    $ git push origin feature
    Git Baby is a git and github fan, let's start git clone.