I created a branch in git to work on my feature (branch called my_branch). I pushed my changes to the branch and then rebased the branch onto master. My company uses git rebase and not git merge.
I ran the following commands:
git checkout master
git rebase master my_branch
git checkout master (seems like I somehow got switched to my_branch so had to switch back to master)
git merge --ff-only my_branch
git log (made sure my code is now in master)
git push origin master
When I try to clean up and delete my local branch, it gives a warning that it's not yet merged to refs/remote/origin/my_branch.
# git branch -d my_branch
warning: not deleting branch 'my_branch' that is not yet merged to
'refs/remotes/origin/my_branch', even though it is merged to HEAD.
error: The branch 'my_branch' is not fully merged.
If you are sure you want to delete it, run 'git branch -D my_branch'.
(please forgive any typos from sanitizing the above message)
When I check our git repo thru my browser and check the branches, I can see my latest code/check-in in "my_branch". I can also see my code in the master branch too.
Why is git complaining that "my_branch" is not fully merged? Can I delete my local branch safely or is git pointing to changes in "my_branch" that will disappear once I delete it locally? If I delete the branch remotely too, will that affect anything?