git pushing to a branch post merge
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] [
In Git, a commit is a snapshot of your repository plus pointers to one or more parent plus some metadata (like author, and commit message).
A branch is a pointer to some commit. That's it.
When you push a branch, you update the remote's pointer to point to the same commit as yours. In addition, your local repo and the remote repo negotiate what snapshots the remote is missing and sends those to the remote. Otherwise, the newly updated remote branch would point at a commit that it knew nothing about.
So, if you push a branch, only that remote branch will change. All the other remote branches will point to the exact same commits as they did before. That said, git-config(1) push.default
can make it easy to push more than you expect. I recommend git config --global push.default nothing
.
You should probably read up on Git Branching some more.