Wednesday, August 31, 2011

Create new local git repo and add existing code to it

1. create repo
$mkdir /dev/repos/proj.git
$cd /dev/repos/proj.git
$git init --bare

2. add existing code to it
$cd /dev/existingdir
$git init
add any directories/files to be ignored to .gitignore in this directory. create .gitignore if it does not exist
$git add *
$git commit -m "message"
$git remote add origin /dev/repos/proj.git
$git remote update
$git push origin master

Tuesday, August 30, 2011

Linux Commands Cheat Sheet

List services with ports, pids, and addresses
$netstat -tulpn

List processes and sort them by fourth column
$ps -e | sort -b -k4

Followers