git commit and push via batch file on Windows

前端 未结 3 1818
眼角桃花
眼角桃花 2021-02-07 05:31

I do same task often of committing and pushing changes to remote branch. Being lazy sometimes, I needed to put set of git commands to automatically perform these steps:

3条回答
  •  無奈伤痛
    2021-02-07 06:03

    For me, by default, Windows executes .sh files correctly using Git Bash. So I would write your script as a regular bash shell script:

    #!/bin/sh
    cd /d/wamp/www/projectName
    git checkout dev
    git add .
    git commit -am "made changes"
    git push
    echo Press Enter...
    read
    

提交回复
热议问题