Git - Make local HEAD the new master -
i decided go few commits because path followed wrong. checked out added cordova .gitignore
commit, , made modifications. illustrated below :
now when push new modifications, error message shows :
error: src refspec (detached aad6423) not match any.
how can tell git discard previous commits (in purple) , continue local head master ?
even though don't want old branch anymore, git doesn't rewriting history or discarding changes. revert , merge.
git branch new_master # name current detached head git checkout master # switch master git revert --no-edit head~4..head # create commits reverting history split git merge new_master # merge git branch -d new_master # don't need anymore
Comments
Post a Comment