Automatic deploy using Git

  • Linux machine with project to deploy with shell access for your user
  • Some server with already prepared branch for deployment (for example origin/master or production), the described below method is suitable for projects that are not compiled (PHP/Python..), but with some more Kung Fu can be adopted to compiled projects too: deploy bin folder with dependencies for .NET, for example.
  1. Install Git.
$ sudo apt-get update
$ sudo apt-get install git
  • Is suitable if you push to and pull from server infrequently.
  • Requires you to enter a password each time you connect.
  • Is more effective if you push and pull from server many times a day.
  • Removes the need to enter a password each time you connect.
  • But requires key generation and exchange
cd ~/.ssh
ssh-keygen -t rsa
Host bitbucket.org
IdentityFile ~/.ssh/id_rsa
conq: logged in as emmap1.
You can use git or hg to connect to Bitbucket. Shell access is disabled.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store