How to bring a pull request to a state of “can be merged automatically”?

I have branched from dev branch into feature branch and made some commits. Now, when i send a pull request to merge a feature branch into dev branch I notice on github that the branch cannot be merged automatically because of some conflicting changes. What do i need to do in order to bring my feature branch into the state of “can be merged automatically”?

What i currently do is:

  • Cannot push to Git with IntelliJ Idea12
  • Updating a bare git repository from a git-svn cloned remote repository
  • Git pull just one commit
  • What does the git staging area contain when the working directory is clean?
  • How to trigger a build only if changes happen on particular set of files
  • Git Flow: How to keep master log clean?
    1. Checkout the dev branch
    2. Merge feature branch
    3. Remember the lines that caused the conflict
    4. Checkout the feature branch
    5. Manually revert each line to the state of the dev branch
    6. Commit and push the patch

    But this looks like many handwork. So i wondered if this can be simplified somehow?


    Mind that i would like to keep my feature branch changes isolated from develop branch (for the purpose of keeping track of which branch introduced regressions and testing each new feature in isolation to other features). So, while merging/rebasing dev into feature would solve the problem, it would bring all the changes made in dev into feature and i would loose isolation.

  • GIT: filter log by group of authors
  • Git remove duplicate commits from history
  • Git branch without current file changes
  • git fetch origin rejected
  • What is the correct GitHub process that I need to follow when changing code?
  • What does git log show me?
  • One Solution collect form web for “How to bring a pull request to a state of “can be merged automatically”?”

    Few assumptions: you took a branch out from dev and called it feature and you want to merge feature into dev

    Your branch feature is not mergeable to dev branch because someone has already made changes todev` which cannot be conflict resolved by git automatically.

    In this scenario, there are two approaches that you can take

    1. Rebase – In this case you will follow these steps below
      • checkout dev
      • take pull from remote
      • checkout feature
      • git rebase dev – Internally, this 1) removes all your commits beyond last
        commit where feature and dev were same 2) applies all dev
        commits 3) one by one apply all feature commits – and as an when
        conflicts occur, git prompts you to fix the conflicts. The last step
        repeats until all your commits have been successfully applied back to
        feature branch.
      • Push all changes to feature branch remote
      • Send in a pull request 🙂

    This is the one that I always follow and it is recommended that you keep taking pull from parent branch regularly to avoid conflicts. This creates a diamond structure in git commit history.

    1. The second one is merge, but I use and find rebase much cleaner and use that always.
    Git Baby is a git and github fan, let's start git clone.