Bird
0
0

You have a feature branch with 3 commits diverged from main. You want to rebase it onto main but keep the original commit timestamps. Which command option should you use?

hard📝 Workflow Q8 of 15
Git - Rebasing
You have a feature branch with 3 commits diverged from main. You want to rebase it onto main but keep the original commit timestamps. Which command option should you use?
Agit rebase --committer-date-is-author-date main
Bgit rebase --preserve-merges main
Cgit merge --no-ff main
Dgit rebase --interactive main
Step-by-Step Solution
Solution:
  1. Step 1: Identify option preserving commit timestamps

    The --committer-date-is-author-date option keeps original author dates during rebase.
  2. Step 2: Match option to goal

    Using git rebase --committer-date-is-author-date main rebases while preserving timestamps.
  3. Final Answer:

    git rebase --committer-date-is-author-date main is correct.
  4. Quick Check:

    Preserve timestamps with --committer-date-is-author-date [OK]
Quick Trick: Use --committer-date-is-author-date to keep commit times [OK]
Common Mistakes:
  • Using --preserve-merges which keeps merges, not timestamps
  • Confusing merge with rebase options
  • Using interactive rebase without timestamp preservation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes