3

Using github Today is 12/1/2012, but I need it to look like I committed/authored a git submission 2 days ago(11/29/2012, any time of day)(the last commit/sync was 11/27/2012). (There have been no other gits since then and I am the only one using this particular git repository. I am using Github and its commandline shell.

I know it has to do with GIT_COMMITER_DATE and GIT_AUTHOR_DATE

However I am not that well versed with manual git commands to do something like this

Thanks!

To Benjamin, I tried setenv, and setenv isn't a valid command? I am using github git commandline

setenv GIT_COMMITER_DATE="11/28/2013 12:30"

Error:
setenv : The term 'setenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.  
At line:1 char:1  
+ setenv GIT_COMMITER_DATE="11/28/2013 12:30"  
+ ~~~~~~  
    + CategoryInfo          : ObjectNotFound: (setenv:String) [],   CommandNotFoundException  
    + FullyQualifiedErrorId : CommandNotFoundException

Also, I tried using Cmd, GitBash, and Powershell for shell clients, no luck on any. (I'm on windows)

Adam namrog84
  • 97
  • 2
  • 10

1 Answers1

6

Set GIT_COMMITTER_DATE and GIT_AUTHOR_DATE as shell environment variables before running git commit.

Benjamin Barenblat
  • 1,311
  • 6
  • 19
  • setenv isn't valid input. Any ideas or alternatives? – Adam namrog84 Dec 01 '13 at 22:06
  • 1
    They are not part of the shell. The environment is a feature of the Unix kernel. Shell variables are *in contrast to* environment variables; try for example `xxx1=1; export xxx2=2; sh -c 'echo $xxx1 $xxx2'` to see the difference. – Mark Dominus Dec 01 '13 at 22:07
  • 2
    @Adamnamrog84 You need to check the manual for the shell you are using, but chances are you can write `GIT_COMMITTER_DATE='…' GIT_AUTHOR_DATE='…' git commit …` – Mark Dominus Dec 01 '13 at 22:08