Skip to content

Instantly share code, notes, and snippets.

@lidox
Last active November 2, 2015 20:56
Show Gist options
  • Save lidox/52d8c2a7382c7a8a2893 to your computer and use it in GitHub Desktop.
Save lidox/52d8c2a7382c7a8a2893 to your computer and use it in GitHub Desktop.
how to work with node.js on serverside and use git to deploy changes on server

Server Commands

start and stop node server

# find node process
ps aux | grep node

# kill node process
kill -9 PROCESS_ID

pm2

#Listing all running processes:
pm2 list
#start server
pm2 start app.js
#stop server
pm2 stop     <app_name|id|'all'|json_conf>

Git Commands

working with git on local developer maschine

# go to project
cd D://
cd projekte/mailrelay/code/

# commit changes to github
git add *
git commit -m "add error logs"
git push origin master

#or do
git push https://github.com/lidox/line_tip.git master

working with git on server side

# go to project
cd /var/postfix_relay_gui/

# pull changes on server
git pull
git merge

pull and override local changes

git reset --hard origin/master
git fetch --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment