I’ve posted a new primer — this one on git. It gives an overview of how git works conceptually and hopefully it can help it become more approachable for people who read it.
>> A git Primer
One task you need to be sure to do when implementing git on a website is to make sure the .git directory isn’t available to the Internet.
This can be done by placing an .htaccess file in the .git directory itself, but a better cleaner way is to place the following line in your main .htaccess file.
RedirectMatch 403 /\.git.*$
::
Sometimes when you first install git you realize you added a bunch of crap to your repository, which makes it bloated. Or maybe you have junk files like .DS_STORE lying around that you want to keep out of your git goodness.
Here’s how to delete from your repository without deleting them from your disk.
# git rm -rf –cached $FILES
Then commit, push, and then pull on any remote repositories.
If you want to delete them from your disk as well you can just omit the --cached bit.
# git rm -rf $FILES
Finally, to keep this from happening in the first place, you can use a .gitignore file to keep certain content from going into your repository. Just wildcard the stuff you’re looking for with asterisks and make a list of those strings in your ignore file.
::

I’ve had a nagging problem for some time where I couldn’t figure out quite how to ignore my wp-content/cache directory when doing syncs with git. It’s not that it was a lot of network traffic, or a lot of storage being used; it’s just messy to sync those cache files every time you make a change to your site–especially since they’re constantly being added and deleted.
So I finally figured out the syntax, and it’s actually quite simple: you just give the relative path of the directory you want to ignore–from the perspective of your root repository. So I work out of my htdocs directory for managing my website, which means you simply add the following to your .gitignore file, which is placed right in the root of htdocs.
cat .gitignore
/wp-content/cache/
Keep in mind, however, that this will only keep you from adding new content from that directory, so in order to purge existing cache files from the repository you need to manually remove them:
git rm -rf –cached wp-content/cache
The --cached piece is important; if you don’t add that you’ll not only remove the files from the git repository, but also from the file system.
Hope this helps. ::
I’ve greatly improved my Using Git to Manage Your Website post. I’ve added scripts for speeding up the upload process on the dev side, enhanced explanations, improved command display, as well as the code to properly execute the automatic update of the live content on the server side using the post-update hook.

[ EDIT: Jul 2011 -- I've replaced this guide with my new git primer, which includes a conceptual explanation of how git works and an updated methodology for handling website management. ]
tcpdump Tutoriallsof Introductiongit Primerfind Command lsof Commandtar Referencelsof TutorialDaniel Miessler | 1999-2012 | Share Alike
Powered by Linode