2

I want to start an application right after git loads in a Windows batch file.

I normally use:

node server.js

How do I incorporate that into:

start "" "%SYSTEMDRIVE%\Program Files (x86)\Git\bin\sh.exe" --login -i
PA.
  • 28,486
  • 9
  • 71
  • 95

1 Answers1

1

You can define your command in your ~/.profile.
You can see a full example in "Windows shortcut to run git bash script":

On the other hand, if you want to run a script and get your shell back, you should :

  • Open the shell as is
  • Edit or create ~/.profile (try vi ~/.profile)
  • Add this line : ~/test.sh (adjust the path if needed)

In test.sh, you can add any command you want, like node server.js (or you could add them directly in the .profile)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250