Resolve a conflict to use local files after a merge goes bad in git pull
benjamin-agaric: looking for a little git help... i've got my repos on the server
I was pulling from it, but when I tried to push i noticed that i must have done it wrong and had the repository url as http
I changed that to the ssh style git. --and i was now connected to the repository two ways
the really weird thing is that when I pushed it said it wasn't up to date (could not fast forward), and when I pulled I got a conflict!!
so regardless of how that happened, and it is quite very strange, since I was pulling all yesterday and I thought one-way pull worked the same however the URL is constructed
stefan-agaric: yes.
benjamin-agaric: How do i now resolve a conflict to use local files after a merge goes bad in git pull?
i tried "git merge ours" and it helpfully informs me I can't do that because I'm in the middle of conflicted merge
stefan-agaric: open the conflicted file.
benjamin-agaric: I did
stefan-agaric: and remove the stuff you don't want.
benjamin-agaric: and i don't want to do that
I know i want what i started with, it seems silly to go line by line
stefan-agaric: to go back to the state before the merge you can git reset --hard HEAD
then try the merge strategy.
git reset works always.
benjamin-agaric: ahh
Side note: the commands pull is made of: pull is fetch and merge.
stefan-agaric: if you can run pull with a merge strategy argument then it should do.
git pull -s ours
and git push worked!
Reference
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#how-to-merge
Comments
Post new comment