question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a FileConflictStrategy property to CheckoutOptions

See original GitHub issue

CherryPickOptions, MergeOptions, RevertOptions already expose such property.

Let’s also make this option available when performing a simple checkout

Related: https://stackoverflow.com/questions/26878695/what-is-the-libgit2sharp-equivalent-of-git-checkout-ours

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sushihangovercommented, Aug 19, 2015

Seeing that the attached PR is not merged and going back to the original question on StackoverFlow which boils down to how you would do a:

  • git checkout --ours

  • git checkout --theirs

    –ours, --theirs When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths.

Since this only applies when you have current unmerged paths (conflicts) while the repo has an active merge state, would it make sense to add a checkout extension to Conflicts.[Ours|Theirs], i.e:

repo.Index.Conflicts[0].Ours.Checkout();
repo.Index.Conflicts[1].Theirs.Checkout();

or a new variant of CheckoutPaths that accepts a Conflict Ours/Theirs IndexEntry:

foreach (var conflict in repo.Index.Conflicts) {
   repo.CheckoutPaths(conflict.Theirs)
}
0reactions
jaccarmaccommented, Mar 24, 2018

All right, thanks for the direction. I guess there’s not a place for a new issue here until the merge-support is in the C library. I’ll still review the existing code and apologies for the sidetrack.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If I `git rm <file>` when I get a 'both added' conflict, will that ...
First, though, don't think about your repository as holding files. It does, but thinking about it this way won't get you anywhere—it's like ......
Read more >
Resolving Merge Conflicts in Git
The complete guide to resolving merge conflicts in Git: learn why issues occur, see how to work through them, undo a merge, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found