Idea for git-touch
Hi all,
I have been using GIT for several time and I love it.
I normally do commits when something works or on the end of the day, just to record what have doing. On other day, when I consider that is done/working I do a rebase -i squashing everything on one commit. The date of that commit will be preserved and is the date of the first commit. Then I do a git-reset HEAD~1, git-add . and git-commit with the same message to have the current date.
A nice functionality was a git-touch that did the commands before.
Best regards and keep the good work,
Luís Sousa
P.S.: While writing this message I realize that is easy to accomplish a git-touch doing a bash script, but probably is a good idea to share.
Hi Luís,
Quoted 2 lines
[...] Then I do a git-reset HEAD~1, git-add . and git-commit with the same message to have the current date.
There is an existing command that does pretty much exactly that:
git commit --amend.
Jan
But still preserves the original date, isn't it?
Quoted 14 lines · Jan Krüger
Hi Luís,
Quoted 3 lines
[...] Then I do a git-reset HEAD~1, git-add . and git-commit with the same message to have the current date.
There is an existing command that does pretty much exactly that:
git commit --amend.Jan
Quoted 1 line · Luís Sousa
But still preserves the original date, isn't it?
Yes, and I just remembered that, too. Sorry. Today is not my day.
Even so, you can still save one command:
git reset --soft HEAD^ git commit
Jan
Yeah, but still need some copy&paste of message :)
Quoted 16 lines · Jan Krüger
Quoted 2 lines · Luís Sousa
But still preserves the original date, isn't it?
Yes, and I just remembered that, too. Sorry. Today is not my day.
Even so, you can still save one command:
git reset --soft HEAD^ git commitJan
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Andreas Ericsson
Quoted 6 lines · Luís Sousa
Yeah, but still need some copy&paste of message :)
Quoted 3 lines · Jan Krüger
Quoted 1 line · Luís Sousa
But still preserves the original date, isn't it?
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Yes, and I just remembered that, too. Sorry. Today is not my day.
Even so, you can still save one command:
git reset --soft HEAD^
git commit
Thanks, but still preserves timestamp.
Quoted 6 lines
Make that
git reset --soft HEAD^ && git commit -C ORIG_HEADand you won't have to bother with copy-pasting.
Quoted 6 lines · Luís Sousa
I normally do commits when something works or on the end of the day, just to record what have doing. On other day, when I consider that is done/working I do a rebase -i squashing everything on one commit. The date of that commit will be preserved and is the date of the first commit. Then I do a git-reset HEAD~1, git-add . and git-commit with the same message to have the current date.
git rebase -i <...>
git rebase --ignore-date <...>
should do what you need.