Gazler / githug

Git your game on!
MIT License
6.86k stars 1.03k forks source link

who can help me? #184

Closed ccysfn closed 9 years ago

ccysfn commented 9 years ago

Name: commit_in_future Level: 20 i cant find the answer,just help me

microdog commented 9 years ago

git commit -m "Commit in future" --date="date -v+1H"

This should work. :)

See http://git-scm.com/docs/git-commit

ccysfn commented 9 years ago

thx a lot ! i use the following command git commit -m "xx"--date 2015-01-25T11:11:11 In the manual there is " --date= " ,and i typed in ,it return the "syntax error". so i use the command above

microdog commented 9 years ago

Your datetime string should be protected by quotes. Just like -m or --message=<msg> option. For example:

git commit -m "Message here" --date="Sat Jan 24 14:16:37 CST 2015"

git commit --message="Message here" --date="Sat Jan 24 14:16:37 CST 2015"

BTW. There is another way to achieve the goal: using environment variables.

env GIT_AUTHOR_DATE="Sat Jan 24 14:16:37 CST 2016" git commit -m "Commit in future"

See http://git-scm.com/docs/git-commit#_date_formats