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.

Partial commit now fails for only one of the files in my repo

See original GitHub issue

Description

I have a file in my repo where I’m trying to commit only select lines in it, but it’s failing with the message The requested changes conflict with one or more files in the repository.

One of the blocks was 2 lines of text that I replaced with a new single line. I couldn’t commit this at all, even trying to commit just the removed lines or the added line resulted in an error.

I can commit individual changes just fine with the native client and other edited files commit just fine as well. In the end I git stash -p and stashed the few things I didn’t want in this commit and then was able to commit the entire file ok.

Version

GitHub Desktop version: 0.6.0 OS version: Win10 CU (10.0.15063)

Steps to Reproduce

I’m unable to reproduce this in any other files. It happened in just this one. I’m not sure if it’s relevant or not but I did restore these changes from a stash before continuing work on them. There were no conflicts in this file when I did that and other changes were committed just fine before getting to this file.

Expected behaviour: I should be able to select a changed block and commit it

Actual behaviour: I’m unable to commit any changes and receive the error The requested changes conflict with one or more files in the repository.

Reproduces how often: On one file only so far

Logs

2017-06-12T18:40:38.575Z - error: [ui] `git apply --cached --unidiff-zero --whitespace=nowarn -` exited with an unexpected code: 1.
error: patch failed: src/Web/Views/PurchaseSeller/Form.cshtml:71
error: src/Web/Views/PurchaseSeller/Form.cshtml: patch does not apply

(The error was parsed as 24: The requested changes conflict with one or more files in the repository.)

Additional Information

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
joshabercommented, Jun 13, 2017

@xt0rted Thanks for sharing that repository with me!

It looks like this was related to the unicode diff bug fixed in https://github.com/desktop/desktop/pull/1970. Since the file contained a unicode character and we’d garble it, the patch couldn’t apply.

0reactions
tierninhocommented, Mar 27, 2019

@kaster14 Sorry you are experiencing issues with partial commits.

Please submit a fresh issue here if you would like us to take a look. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git error on commit after merge - fatal: cannot do a partial ...
If there is a merge, you cannot do a partial commit, meaning you have to commit everything that has changed, added, or deleted....
Read more >
How to Git Partial Commit Effortlessly - Vershd
How to achieve a Git partial commit of a file, instead of the whole of it. We show you how to commit one...
Read more >
PyCharm - Commit and push changes to Git repository
Open the vertical Commit tool window Alt+0 located on the left: · As your changes are ready to be committed, select the corresponding...
Read more >
cannot commit "annex add"ed modified file which switched its ...
Leads to a failure of 'git commit' upon attempt to commit a file which went from "largefile" to small, according to .gitattributes settings,...
Read more >
4. Undoing and Editing Commits - Git Pocket Guide [Book]
With Git, however, this is not a problem, since you are committing to your own private repository. You are free to delete or...
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