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 8682447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:46:36+00:00 2026-06-12T21:46:36+00:00

Lately I’ve been using git show <hash> to create diffs for later reference because

  • 0

Lately I’ve been using git show <hash> to create diffs for later reference because it’s easier to type than git diff <hash>~ <hash> and it shows the commit information (timestamp, user, hash, comment). You can then use git apply <filename> to apply the patch.

I discovered that git show -3 will show the last three commits along with the same extra information. However, git apply will squash it all into the working directory as unstaged changes, and loses all the commit information.

Is there something in git that will apply all that information? It would be a lot simpler to just pass in a flag than breaking the patch up into three files, applying them severally, and creating new commits.

  • 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-12T21:46:38+00:00Added an answer on June 12, 2026 at 9:46 pm

    You can use git format-patch to generate MIME emails representing the commits, including their metadata (message, authorship, etc). You can then reapply these with git am.

    So git format-patch HEAD~3 will generate 3 patches for the last 3 commits, and you can then pipe these all into git am. If you want to be simpler, git format-patch --stdout HEAD~3 will send the MIME messages out on stdout, so you can pipe them around where you want instead of dealing with 3 separate files.

    Of course, if you’re trying to save commits to reference later, why not just tag them? You can then reapply the commits from them using git cherry-pick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lately, I have been using Automatic Reference Counting in my Objective-C/iOS programs, and have
Lately I've been favoring using named pipes (option --enable-named-pipes) in MySQL running on windows,
Lately I've been writing some JS code using jQuery and JavaScript as it is
Lately I've been using XPathDocument and XNavigator to parse an XML file for a
Lately I have been working on trying facial recognition with the Kinect, using the
Lately I have been using reflection to work in my project, and I have
Lately I have been trying my hands on Eclipse IDE for java development. I
Lately, I'v been struggling with an annoying situation on ASP.NET MVC. Here's the story
Lately I've been thinking a lot about building a website/blog/community oriented site. However I
Lately I've been job hunting, and for the most part, they would ask me

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.