Skip to content

Instantly share code, notes, and snippets.

@rrrhys
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrrhys/793e287799d74a2bca14 to your computer and use it in GitHub Desktop.
Save rrrhys/793e287799d74a2bca14 to your computer and use it in GitHub Desktop.
Git shortcut bash file for windows - show modified files, ask for commit message, commit and push to remote.
ssh root@111.222.333.444 'cd /var/www/project; git pull; php artisan migrate --force; echo "All done!"'
git add .
git status
@echo off
set /p msg="Commit msg: "
REM Ask for the commit message.
git commit -m "%msg%"
git push

How to:

Run ssh-keygen to generate a private/public keypair on your development machine.

Copy contents of id_rsa.pub to clipboard.

Paste the id_rsa.pub contents into ~/.ssh/authorized_keys on the server.

Change "111.222.333.444" to your remote server IP. (deploy.bat)

Change "/var/www/project" to the path of your project on the server. (deploy.bat)

Run gap & deploy to git add, commit, push, log in to server, pull, migrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment