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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:49:11+00:00 2026-05-17T18:49:11+00:00

I work in a branch ‘develop’, and when ready to merge with master, use

  • 0

I work in a branch ‘develop’, and when ready to merge with master, use interactive rebase to squash all my little commits into one feature-encompassing commit which I gets applied on top of master.

Works well, only issue I have is the time the commit is labelled is of the first small commit. It makes sense as that is the only commit that is ‘picked’, the rest are ‘squashed’. Anyone know how to have the lumping commit be labeled with the time of the last small commit rather than the first? It may be possible to do so by ‘editing’ the earliest commit and squashing the later commits into this commit (which I presumably can edit the time property) however is there a better way?

  • 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-05-17T18:49:11+00:00Added an answer on May 17, 2026 at 6:49 pm

    If you can not just rearrange the commits to pick the one with your desired date (e.g. because the last commit will not apply cleanly atop the parent of the first commit), then you might try the following method.

    If you have squashed together your develop commits into a single commit on develop, then you can use git show and the reflog of develop to extract the date of the original final commit (prior to squashing) and then amend the date of your new commit with git commit --date=.

    git commit --amend -C HEAD --date="$(git show --pretty=format:%ad develop@{1})"
    

    This amends (--amend) the HEAD commit so that

    • it has the commit message and date from HEAD,
      (-C HEAD; using this avoids starting an editor for the commit message just to immediately quit it without making any changes; leave this part off if you actually want to edit the commit message as well as changing the date)
    • its date is
      (--date=)

      • the same date as most recent prior tip of develop
        ("$(git show --pretty=format:%ad develop@{1})").

    If develop@{1} does not have the date you want, then you can use git log -g develop to find a commit that has the date you want.

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

Sidebar

Related Questions

I work 100% with a branch that I made off of the master branch.
All M-x egg- commands work ok M-x egg-start-new-branch start new branch with name: xxx
So I usually create a feature branch in git, work on it, then merge
How can I move my work and changes from the master branch to a
My normal pattern is to branch from master, do a ton of work, then
I am trying to work out how to use the Branch-per-feature approach in mercurial
So say I have my master branch, and I create feature-x branch to work
I've done a fair bit of work (Your branch is ahead of 'origin/master' by
I usually work on my Master branch, and push to Production. I accidentally worked
I have the following tree: O---O---O---O <- master \--O---O <- work branch /\ ||

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.