Initial Setup

git config --global user.name 'Your Name'
git config --global user.email 'you@example.com'

Key Commands

git clone https://github.com/user/repo.git
git pull origin main
git add .
git commit -m 'update'
git push origin main

Deploy with Git Hooks

# On server: setup bare repo
git init --bare /srv/myapp.git
# post-receive hook
GIT_WORK_TREE=/var/www/myapp git checkout -f