git pushing to a branch post merge

branching-and-merging, git, git-branch, git-merge

Solution

After the merge you still have 2 branches, the one that you merged from and the one that you merged into, which is usually still your active branch.

The new commit will go to branch that is checked out and that is either master or the other branch.

Note, that we don't push to a branch: we commit to a branch and push the branch to a remote repository. And we do not update commits, we add new commits to the repository. Commits never change.

Addition - Sure, you still can push to the "old" branch. And merge it into master again:

A - B - - - E - G      [master]
     \     /   /
      C - D - F        [issue_202]

But I'd prefer creating a new branch to fix the issues. It's a question of workflow. Assume, the work is ticket-based, then the issue_202 ticket goes to resolved before you merge into master. So to my opinion, the additional work is not a fix on the issue_202 but a fix for the master branch and so I would create a new ticket and a new branch to fix the issues:

              F        [issue_202_1]
             / \
A - B - - - E - G      [master]
     \     /  
      C - D            [issue_202] [

Problem

If I push to a branch after merging it with `master`, how will git handle it (Update the latest commits pushed in branch to `master` automatically OR do nothing OR do something else) ?

Original source