by using capistrano, you can run whatever you want on the server
task :execute_on_server do
on "root@example.com" do
execute "some_command"
end
end
other than that, you usually put a .keep
file in a directory that is necessary but that you do not want to track otherwise. so when you checkout the application, the folder is there but "empty".