Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:29:04+00:00 2026-06-13T22:29:04+00:00

I have a shallow clone, on which i made three commits. Here is the

  • 0

I have a shallow clone, on which i made three commits.
Here is the log:

$ git log –oneline –graph –decorate –all
* d3456fd (HEAD, master) patch 3
* 9713822 patch 2
* 6f380a6 patch 1
* 8a1ce1e (origin/master, origin/HEAD) from full clone
* 7c13416 added from shallow
* 3b3ed39 removed email
* cfbed6c further modifications
* a71254b added for release 2.1
* 7347896 (grafted) changes for release 2

now i create a patch from here:

$ git format-patch -k –stdout origin > ../format_since_origin.patch

I want to apply this patch in another clone, which is a full clone.
Here is the log:

$ git log –oneline –graph –decorate –all
* 8a1ce1e (HEAD, origin/master, master) from full clone
* 7c13416 added from shallow
* 3b3ed39 removed email
* cfbed6c further modifications
* a71254b added for release 2.1
* 7347896 changes for release 2
* b1a8797 changes to ttwo files
* 603710c changed test report
* 16b20b3 added test_report.txt
* f0871ea modified file1.xml
* dd94bfc added file1.xml
* 00758aa second commit
* 49f9968 first commit

I am unable to apply the patch created from the shallow clone above. I get the following error.

$ git am -3 /c/temp/git/format_since_origin.patch
Applying: patch 1
Using index info to reconstruct a base tree…
error: patch failed: file1.c:6
error: file1.c: patch does not apply
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.
Patch failed at 0001 patch 1
When you have resolved this problem run “git am –resolved”.
If you would prefer to skip this patch, instead run “git am –skip”.
To restore the original branch and stop patching run “git am –abort”.

Any idea why this patch is failing? Or is my method totally wrong?

Update:

It works with the following

$ git am -3 –ignore-whitespace /c/temp/git/format_since_origin.patch
Applying: patch 1
Applying: patch 2
Applying: patch 3

Now, as suggested by Charles – if i try the git diff, i get the error as below.

$ git diff -p origin > ../dif_origin.patch

On applying,

$ git apply –ignore-whitespace –inaccurate-eof /c/temp/git/dif_origin.patch
c:/temp/git/dif_origin.patch:9: trailing whitespace.
patch change for file1.c
c:/temp/git/dif_origin.patch:18: trailing whitespace.
patch this xml guy
c:/temp/git/dif_origin.patch:29: trailing whitespace.
fsdfsd
c:/temp/git/dif_origin.patch:30: trailing whitespace.
patch this report
error: patch failed: file1.c:6
error: file1.c: patch does not apply
error: patch failed: file1.xml:2
error: file1.xml: patch does not apply
error: patch failed: tr/test_report.txt:2
error: tr/test_report.txt: patch does not apply

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:29:05+00:00Added an answer on June 13, 2026 at 10:29 pm

    Note that one rationale for having to ignore whitespace was (June 2010):

    What it does is enable the GMail -> download -> git-am workflow.
    GMail (and doubtless countless other) E-Mail providers introduce whitespace at the beginning of raw E-Mail messages, while otherwise leaving them intact.

    As mentioned in “git am/format-patch: control format of line endings“, you can try a:

     git am --keep-cr
    

    That wouldn’t require you to ignore whitespace (warning only).

    The OP maxmelbin confirms in the comments that the following works:

     git am -3 --keep-cr --committer-date-is-author-date /c/temp/git/format_since_origin.patch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Follow-up of this so-question: if I have a shallow clone, how to fetch all
Okay so here's the thing: I have a linq query which loads approx. 1000
I have read the answer for difference between deep copy and shallow copy from
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
Have an issue with marshall and unmarshall readers and writers. So here it is.
I have 2 objects from the same type and i would like to shallow
I have been using git-svn to work remotely on a spike for a new
I have very shallow knowledge of JavaScript, and need to provide a calendar to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.