How to Pass Multiple Commands to Git BASH -


new git. running on windows. when run command in .sh file (from bash shell), works:

cd /c/somedir && git commit -a -m "commit comment"

i want variable comment, want call: c:\program files\git\usr\bin\bash.exe , pass above command (2 commands chained) parameter (with different comment each time).

it doesn't work; looking ideas...

clarification: i'm using utility run commands, basically, want call:
executable:
c:\program files\git\usr\bin\bash.exe
parameters (if test.sh has needs comment):
bash /c/somewhere/test.sh "my comment"

alternatively, parameters be:
cd /c/myrepodir && git commit -a -m "my comment"

further: after creating .sh script, calling bash, , running script, still error, "paths -a not make sense." then, after doing what's recommended here (same commands), still same error.

try putting $1 in reference first parameter

cd /c/somedir && git commit -a -m "$1" 

so myscript.sh contains line, then

bash myscript.sh "this commit message" 

an alternative approach using cd pushd , popd

#!/bin/bash pushd mygitdir git commit -a -m "$1" popd 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -