3 This pretentiously named page is my dumping ground for uncategorized Git tricks.
7 For my projects, Git tracks exactly the files I'd like to archive and release to users. So to create a tarball of the source code, I run:
9 $ git-archive --format=tar --prefix=proj-1.2.3/ HEAD
11 == Changelog Generation ==
13 It's good practice to keep a [[http://en.wikipedia.org/wiki/Changelog][changelog]], and some projects even require it. If you've been committing frequently, which you should, generate a Changelog by typing
17 == Git Over SSH, HTTP ==
19 Suppose you have ssh access to your web server, and it does not have Git installed, which is not an uncommon situation. Then download, compile and install Git in your account.
21 Create a repository in your web directory:
23 $ GIT_DIR=proj.git git-init
25 and in the "proj.git" directory, run
27 $ git --bare update-server-info
28 $ chmod a+x hooks/post-update
30 From your computer, you can push via ssh:
32 $ git push web.server:/path/to/proj.git HEAD
34 and people can get your project via
36 $ git clone http://web.server/proj.git
38 == Commit What Changed ==
40 Telling Git when you've added, deleted and renamed files gets tedious. Instead, try:
42 $ git-ls-files -d -m -o | xargs git-update-index --add --remove
44 and Git will look at the files in the current directory and work everything out for itself.
46 You might want it to ignore particular files:
48 $ git-ls-files -d -m -o -x *.tmp | xargs git-update-index --add --remove
50 If you have a big list of directories and files that should never be version controlled, type them into a separate file named "ignore" and run:
52 $ git-ls-files -d -m -o -X ignore | xargs git-update-index --add --remove
56 In true UNIX fashion, Git's design allows it to be easily used as a low-level component of other programs. There are GUI interfaces, web interfaces, alternative command-line interfaces, and perhaps soon you will have a script or two of your own that calls Git.
58 See [[http://git.or.cz/][the Git homepage]] for some examples.