Skip to content

Commands Cheatsheet

Antonio Vivace edited this page Dec 3, 2018 · 7 revisions

Some useful practices and commands used during development.

  • Dopo aver mergiato un branch, per continuare il lavoro su quel branch rimettendosi in pari con master:
# Assicurarsi di essere su master (o develop)
git checkout master
git pull
# Cancella branch localmente
git branch -D nomeBranch
# Cancella in remoto
git push origin --delete nomeBranch
# Ricrea branch
git branch -m 'nomeBranch'

Durante il primo push, specificare il branch da cui tracciare da remoto

git push --set-upstream origin nomeBranch

  • Save the pi ip and ssh login informations in .ssh/config
Host pi
  Hostname x.x.x.x
  User pi
  IdentityFile ~/.ssh/id_ed25519
  • Use an SSH key (without password or with password saved by an ssh-agent) to automatically ssh to rpi (ssh pi)
  • Development/Editing files on the instance deployed on Raspberry
    • Rsync over ssh on each change and work locally (setup your editor to do this on each change). Do git things locally. rsync -rtv cb/coderbot/ pi@pi:/home/pi/coderbot
    • Mount with sshfs sudo sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa [email protected]:/ /mnt/droplet (on LAN works well)
    • Edit there with vim
    • commit/pull each change on a draft branch
  • Send a POST request passing a payload JSON curl -d @payload.json -H "Content-Type: application/json" PAYLOAD/URL/SOME/POST, or a JSON string curl -d '{'a' : 1}' -H "Content-Type: application/json" PAYLOAD/URL/SOME/POST
Clone this wiki locally