You pull. You have conflicts. You want to go back to how it was before pulling and push your version. How do you do that without editing the file line by line? -- Posted via ruby-forum.com.
Milan Dobrota wrote:> You pull. You have conflicts. You want to go back to how it was before > pulling and push your version. How do you do that without editing the > file line by line?Use git mergetool? Anyway, this question is probably better asked in a Git forum. Best, -- Marnen Laibow-Koser marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via ruby-forum.com.
Milan Dobrota wrote:> You pull. You have conflicts. You want to go back to how it was before > pulling and push your version. How do you do that without editing the > file line by line?If conflicts occur during a pull the auto-merge should fail leaving the changes in your working tree. At this point you should be able to run: git reset --hard to return your working tree to the tip of the current branch. P.S. I agree this question would be more appropriate for a git forum. -- Posted via ruby-forum.com.
Marnen Laibow-Koser wrote:> Milan Dobrota wrote: >> You pull. You have conflicts. You want to go back to how it was before >> pulling and push your version. How do you do that without editing the >> file line by line? > > Use git mergetool?Milan, If you are interested in seeing a short demonstration of conflict resolution in git you can watch my screencast on the subject here: vimeo.com/5728959 -- Posted via ruby-forum.com.
2009/8/19 Milan Dobrota <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > You pull. You have conflicts. You want to go back to how it was before > pulling and push your version. How do you do that without editing the > file line by line? > --Just checkout your version from your local repository again. If the pull failed due to conflicts then so will a push, in fact I believe it is always best to pull, sort the conflicts, commit then push. Colin
Colin Law wrote:> Just checkout your version from your local repository again. If the > pull failed due to conflicts then so will a push, in fact I believe it > is always best to pull, sort the conflicts, commit then push.From man git-merge: HOW TO RESOLVE CONFLICTS After seeing a conflict, you can do two things: o Decide not to merge. The only clean-ups you need are to reset the index file to the HEAD commit to reverse 2. and to clean up working tree changes made by 2. and 3.; git-reset --hard can be used for this. git pull is basically git fetch + git merge. If conflicts occur this should happen in the git merge phase. From that point you can choose to resolve the conflicts and commit or, as stated above, choose not to merge. Using git reset --hard can be used for the later as I stated in an earlier post. -- Posted via ruby-forum.com.
Thank you guys. git merge tool is awesome!!! :) -- Posted via ruby-forum.com.