mysqldump 'my_project' \ sed -E s/meu-projeto.local/meu-projeto.com/g \ > meu-projeto.sql WordPress salva inúmeras URLs do ambiente de desenvolvimento no banco de dados, complicando a vida do desenvolvedor :(
na verdade o conteúdo de um(a) outro(a) arquivo/pasta. # creates a symbolic hosts file in user's home dir; # any change made on it will directly be stored on # original /etc/hosts ln -s /etc/hosts ~/hosts
destino): # Debian, Ubuntu, Linux Mint, elementary OS, etc. sudo apt-get install rsync # macOS comes with rsync pre-installed, but most recent # versions are available on Homebrew brew install rsync
senha: # generate a key pair of SSH keys ssh-keygen -t rsa -b 4096 # adds it to ssh-agent ssh-add # get the contents of id_rsa.pub to enter on GitHub cat ~/.ssh/id_rsa.pub # copy the output and send to GitHub (Account > SSH keys) # test the connection ssh -T [email protected]
bare repository that works pretty much # like GitHub repositories (you can `git push` to them) git init --bare ~/my-project.git Na máquina local: # add the bare repo as a remote to your project git remote add server you@host:~/my-project.git # `git push` to your bare repo git push server master
hook para executar uma ação automaticamente após receber dados no repositório: + ~/my-project.git/ +-- HEAD +-- config +-- (...) +-- hooks/ +----- post-update <- post-update hook (Bash script)