Reputation: 17594
I have created a new feature branch from the development branch. Made the changes and committed and then pushed. Merged the new feature branch into the development on GitLab. The source branch (i.e. feature branch) is deleted. Locally I checked out back to development and did a git pull to merge the changes into development.
Problem Now I notice that I still have to adjust one file.
Question How do I proceed?
Should I check out the changes locally in the old feature branch and then push again?
Or do I have to create a new feature branch. So create a new branch from development. Make the changes and push?
Upvotes: 0
Views: 244
Reputation: 12270
Both your proposed solutions will work, as long as you don't try to undo the original merge.
If you still have the original feature branch on your computer, you can add commits to it and merge it into development a second time.
If you don't, these are two fine options:
Create a feature-fix branch from development. It's the simplest solution and, really, there is nothing wrong with it.
Create that feature-fix branch from the last commit in the original feature branch:
git checkout <last sha1 before merge>
git checkout -b feature-fix
Now add and commit your missing stuff. When you merge feature-fix into development, it'll be clear that it was adding to that feature by the parentage of the commit that added the missing stuff.
You can even reuse the original feature branch name here if you want.
Important: what you should not do is try to repair the original feature branch and redo the original merge. That history has been pushed, your team will hate you if you rewrite it and force push it.
Upvotes: 1