.. index:: single: gitcommitwd gitcommitwd =========== Commit or ammend a commit with a custom date. -------------- :: File Name : gitcommit.ps1 Author : Adewale Azeez - iamthecarisma@gmail.com Date : Mar-30-2020 -------------- Commit with a custom date. To commit in the past set the day value to - number of days in past. E.g. to commit - 3 days ago set the Day value to -3. Add and commit all the edited file to git with the commit message as the variadic arguments without quotes Syntax ------ .. code:: powershell gitcommitwd [[-Day] ] [-Amend] [-args] [] Parameters ---------- -Day :Int32 ~~~~~~~~~~~ =========================== ===== attr value =========================== ===== Required? false Position? 1 Default value 0 Accept pipeline input? false Accept wildcard characters? false =========================== ===== -Amend [:SwitchParameter] ~~~~~~~~~~~~~~~~~~~~~~~~~ =========================== ===== attr value =========================== ===== Required? false Position? named Default value False Accept pipeline input? false Accept wildcard characters? false =========================== ===== -args :String[] ~~~~~~~~~~~~~~~ =========================== ===== attr value =========================== ===== Required? true Position? 2 Default value Accept pipeline input? false Accept wildcard characters? false =========================== ===== CommonParameters ~~~~~~~~~~~~~~~~ This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). Inputs ------ [int] [switch] System.String[]] Outputs ------- [System.String[]] EXAMPLE 1 --------- :: gitcommit 0 -Amend from here is the commit message your last commit will be ammended with the message “from here is the commit message” The command is equivalent to git add .; git commit –amend -m “from here is the commit message”; EXAMPLE 2 --------- :: gitcommit -3 from here is the commit message your changes will be commit with the message “from here is the commit message” plus the author and commit date will be set to 3 days ago. The command is equivalent to git add .; GIT_AUTHOR_DATE=‘Sun Feb 21 10:03:02 2021 -0400’ GIT_COMMITTER_DATE=‘Sun Feb 21 10:03:02 2021 -0400’ git commit -m “from here is the commit message”; Related links ------------- - https://thecarisma.github.io/Cronux - https://git-scm.com/docs/git-add - https://git-scm.com/docs/git-commit