I have a feature
branch called featureA
and I am the only developer who is and will be touching this branch until it gets merged to master
branch.
My git command history is:
- committed changes locally
- made more changes then pushed to remote by amending commit
- made one more change (on a single line) then pushed to remote by amending commit
BUT it seems NOT pushed to the remote repository.
git status
outputs:
Your branch and origin/featureA
have diverged, and have 1 and 1 different commits each, respectively. (use git pull
to merge the remote branch into yours)
git diff
shows that:
- local branch: the last single line change is applied
- remote origin branch: the last single line change is not applied
My featureA
branch will be merged to the master
branch so I don't want to ruin history.
I went through several threads (suggesting git pul --rebase
, git reset --hard
, etc) but still do not have clear idea what is the best solution.
I don't mind which state I will be on with the solution. If needed, I don't mind to go back to the previous push/commit and push the new change as a new commit again because it is just a single line code change.
I appreciate your help.