var sys = require(\'sys\'),
exec = require(\'child_process\').exec;
exec(\"cd /home/ubuntu/distro\", function(err, stdout, stderr) {
console.log(\"cd: \" +
Each command is executed in a separate shell, so the first cd only affects that shell process which then terminates. If you want to run git in a particular directory, just have Node set the path for you:
exec('git status', {cwd: '/home/ubuntu/distro'}, /* ... */);
cwd (current working directory) is one of many options available for exec.