User login

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
Merge made by ours.
and git push worked!

Reference

http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#how-to-merge

Resolution

Searched words: 
git resolve conflicts use local isn't going to work because it doesn't know what is on the server until i pull

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.