I have a branch, say "XYZ", I worked and did a few commits on that branch and later merged it with my master branch. Now, I want to do some more changes in my code and want to use that same branch. I have not deleted the branch.
Can I use the same branch again? Can I then merge the new commits with master again? Or is the only solution to create another branch?
You can continue working on your branch and then when you merge with master again, it will bring the commits that are missing on master.
Yes you can being on a new branch doesn't stop you from using a commit.
In the event that you require a merge commit during a fast forward merge for record keeping purposes you can execute git merge with the --no-ff option. This command merges the specified branch into the current branch, but always generates a merge commit (even if it was a fast-forward merge).
The answer is: nothing happens to the feature branch as a result of the merge.
You can still work on that branch as it still exists.
The git-merge documentation says:
Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch.
You can continue working on your branch and then when you merge with master again, it will bring the commits that are missing on master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With