Skip to content

Instantly share code, notes, and snippets.

@bhank
Last active June 23, 2020 00:06
Show Gist options
  • Save bhank/baad6de2b7a8e95863f43745eb5d0e19 to your computer and use it in GitHub Desktop.
Save bhank/baad6de2b7a8e95863f43745eb5d0e19 to your computer and use it in GitHub Desktop.
Batch file for launching TortoiseGit commands
@ECHO OFF
SET GITCOMMAND=%1
SET GITPATH=%2
SET GITPARAMS=%3
IF "%GITCOMMAND%"=="" GOTO :EOF
IF NOT "%GITPATH%"=="" SET GITPATH=/path:%GITPATH%
IF /I "%GITCOMMAND%"=="ci" SET GITCOMMAND=commit
IF /I "%GITCOMMAND%"=="status" SET GITCOMMAND=repostatus
IF /I "%GITCOMMAND%"=="s" SET GITCOMMAND=repostatus
IF /I "%GITCOMMAND%"=="refs" SET GITCOMMAND=refbrowse
IF /I "%GITCOMMAND%"=="browserefs" SET GITCOMMAND=refbrowse
IF /I "%GITCOMMAND%"=="refbrowser" SET GITCOMMAND=refbrowse
IF /I "%GITCOMMAND%"=="stash" SET GITCOMMAND=reflog&& SET GITPARAMS=/ref:refs/stash
IF /I "%GITCOMMAND%"=="graph" SET GITCOMMAND=revisiongraph
IF /I "%GITCOMMAND%"=="compare" SET GITCOMMAND=showcompare&& SET GITPARAMS=/revision1:%3 /revision2:%4
IF /I "%GITCOMMAND%"=="help" START https://tortoisegit.org/docs/tortoisegit/tgit-automation.html && GOTO :EOF
IF /I "%GITCOMMAND%"=="/?" START https://tortoisegit.org/docs/tortoisegit/tgit-automation.html && GOTO :EOF
IF /I "%GITCOMMAND%"=="" START https://tortoisegit.org/docs/tortoisegit/tgit-automation.html && GOTO :EOF
start tortoisegitproc.exe /command:%GITCOMMAND% %GITPATH% %GITPARAMS%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment