1

Let's assume that a series of commits were made throughout the day:

[1:00pm] $ commit -am "commit 1"
[2:00pm] $ commit -am "commit 2"
[3:00pm] $ commit -am "commit 3"

Instead of pushing all of these commits at once, I would like to replay the commits, while pushing each one at delayed times.

How can I push each commit one at a time with new future time stamps, so that it appears to the upstream, that changes are being worked on live?

[1:00pm] $ commit -am "commit 1"
[2:00pm] $ commit -am "commit 2"
[3:00pm] $ commit -am "commit 3"

[3:00pm] $ ./begin-pushing

[4:00pm] $ push; #upstream sees commit 1 was done at 4:00pm
[5:00pm] $ push; #upstream sees commit 2 was done at 5:00pm
[6:00pm] $ push; #upstream sees commit 3 was done at 6:00pm
5
  • One of the fundamental aspects of Git is that when a commit is made, everything about that commit (including the timestamps) is set in stone. Changing any information (such as a timestamp) requires creating a new commit with a new identity (new sha1) which reflect your new desired timestamp information. Aug 10, 2015 at 2:27
  • @GregHewgill I agree that this is not something very common in normal git workflows. However, a lot of people already do similar behaviour when rewinding with rebase. My commits in this situation are less 'set in stone', because they have not yet been pushed upstream. Aug 10, 2015 at 2:35
  • 1
    Ok, sure you could certainly use rebase for this. See Change timestamps while rebasing git branch for example. Aug 10, 2015 at 2:37
  • 1
    Why do you want this?
    – Schwern
    Aug 10, 2015 at 4:01
  • In addition to the comment by @GregHewgill you may find more example here stackoverflow.com/questions/454734/…
    – joran
    Aug 10, 2015 at 6:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.