Logo

dev-resources.site

for different kinds of informations.

How do I make a Git commit in the past?

Published at
1/27/2024
Categories
git
github
commit
programming
Author
Atul Tripathi
Categories
4 categories in total
git
open
github
open
commit
open
programming
open
How do I make a Git commit in the past?

How can I create a Git commit for a previous date? Here's the process:

  1. Add your changes:
    git add .

  2. Commit your changes with a specified date:
    git commit --date "10 day ago" -m "Your commit message"
    or
    git commit --date "24-02-2023" -m "Your commit message"

  3. Finally, push your code:
    git push

Thank you, and happy coding!

Featured ones: