1

I have a html/css/js website which is stored in GitHub and developed on my Windows 10 machine using Visual Studio 2019.

Currently I'm deploying it using the Git Bash console and then running a git ftp command to push any deltas to the server.

Specifically:

  1. I have pinned shortcut on the task bar which opens Git Bash in the root directory of the website. enter image description here
  2. Once the console has opened, I execute the following command to push to the server: "git ftp -v -u "frankray" push"

A two click deployment is no big deal, but I'd really like to do this in one click from the task bar (as a prelude to automating the CI).

Problem: I cannot for the life of me workout how to pass in the git ftp command into the console and run it, say from a batch file or perhaps directly calling git-bash.exe with the command passed in as a parameter.

I can't imagine it's hard to do, but I haven't worked out what I've been doing wrong. Please help.

Frank Ray
  • 51
  • 1
  • 8
  • Maybe [this post from superuser](https://superuser.com/questions/1104567/how-can-i-find-out-the-command-line-options-for-git-bash-exe) could help! Try something like the following 'target': `"C:\Program Filies\Git\git-bash.exe" -c 'git ftp -v -u "frankray" push'` – 0stone0 Sep 03 '20 at 15:37
  • 1
    @0stone0 Thanks, that superuser link points ultimately to the solution, "Correct there isn't a list of command line options help for git-bash.exe". Also your suggestion above works (except type-o 'Filies' in your path). if you want to repost it as the question answer, I'd be happy to mark as the correct answer. – Frank Ray Sep 04 '20 at 08:43

1 Answers1

0

Posting my comment as an answer

Unfortunately there isn't a list of command line options for git-bash. This superuser question may provide some more info.


A possible solution (verified by OP) is passing the -c parameter (command to be executed) to the target like so;

"C:\Program Files\Git\git-bash.exe" --cd="C:\Users\frank\Documents\Professional\Contracting\5. Frank Ray & Associates Ltd\Website\frankray.net" -c 'git ftp -v -u "frankray" push ; read -p "Press any key to continue"'
Frank Ray
  • 51
  • 1
  • 8
0stone0
  • 34,288
  • 4
  • 39
  • 64