{"id":175,"date":"2015-07-28T12:56:37","date_gmt":"2015-07-28T12:56:37","guid":{"rendered":"http:\/\/linux.suriyasuneel.com\/?p=175"},"modified":"2015-07-28T12:59:15","modified_gmt":"2015-07-28T12:59:15","slug":"automate-git-bash","status":"publish","type":"post","link":"http:\/\/linux.suriyasuneel.com\/?p=175","title":{"rendered":"Automate Git Bash"},"content":{"rendered":"<h2>Connect to Linux machine<\/h2>\n<p>How to connect to a linux machine from a git bash terminal on Windows 7 machine.<br \/>\nGit bash is already a batch command executed from the dos command prompt.<br \/>\nSo if you want to execute a linux shell script such as<\/p>\n<pre>\"connect_to_jc.sh\"<\/pre>\n<p>, then you need to create a batch file that will start a git bash terminal and then execute this shell script.<\/p>\n<h3>First create a shell script that looks like as follows<\/h3>\n<pre>export DISPLAY=localhost:0.0\r\nssh -X -p &lt;port_number&gt;  -i &lt;location_of_the_private_key&gt;  &lt;user@server&gt;\r\n<\/pre>\n<p>The above shell script will set the display to forward X11 and use the private key to connect to the linux machine.<\/p>\n<h3>Now create the batch file<\/h3>\n<pre>C:\\Windows\\System32\\cmd.exe \/c \"\"C:\\Program Files (x86)\\Git\\bin\\sh.exe\" --login -i -- C:\\Projects\\connect_to_jc.sh\"<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Connect to Linux machine How to connect to a linux machine from a git bash terminal on Windows 7 machine. Git bash is already a batch command executed from the dos command prompt. So if you want to execute a linux shell script such as &#8220;connect_to_jc.sh&#8221; , then you need to create a batch file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts\/175"}],"collection":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=175"}],"version-history":[{"count":1,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions"}],"predecessor-version":[{"id":176,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions\/176"}],"wp:attachment":[{"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/linux.suriyasuneel.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}