If you are on a feature branch on which you are working alone:
First make the changes to the file and create a new commit.
git commit -m "message here"
Make sure you are on your feature branch
git checkout your_feature_branch
git rebase -i parent_branch (the branch the your_feature_branch was forked from)
The editor will the pop up with options. Change the tag from squash
for the 2nd line. You will then have the option to edit your commit message. You can remove the one commit message and update with different text.
Shift+zz (exit for vi)
If you attempt git push your_feature_branch
here you will receive the following error:
$ git push your_feature_branch
To https://your_repo.git
! [rejected] your_feature_branch -> your_feature_branch (non-fast-forward)
error: failed to push some refs to 'https://your_repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Which is expected because of the local changes you made - to overcome this use:
git push your_feature_branch --force
The above command will push the changes to remote repo.
NOTE:
Usage of --force is not standard or recommended so only use this if you know what you are doing. It is permitted in this case because the assumption is that you are the only one working on your_feature_branch
I am assuming you are working alone on your feature branch.