I have a repository where a stash
is applied. However now the code looks likes this:
<<<<<<< HEAD
wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
} else {
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
=======
wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
} else {
wp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
>>>>>>> dev-wip
The problem is now the stash
is not showing in the git
. And it does not show any conflicts. How to resolve this?
What you are seeing is how Git represents a merge conflict in a source code file. The markers <<<<<<<
, =======
, and >>>>>>>
are merge conflict markers, and they separate the two versions coming from each parent in the merge. I am guessing that the version dev-wip
is coming from your Stash. If you want to use that version, then just edit your file so the snippet above looks like this:
wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
} else {
wp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] .$_SERVER['REQUEST_URI'] );
Then, save the file and finish applying the stash. You may want a version which is a combination of the two shown to you. In that case, make the appropriate edit.
Note that you should generally lean towards doing git stash apply
rather than git stash pop
, because the latter removes the stash from the stack, and it won't be available again later should something go wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With