forked from blynn/gitmagic
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrandmaster.txt
58 lines (30 loc) · 2.04 KB
/
grandmaster.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
= Git Grandmastery =
This pretentiously named page is my dumping ground for uncategorized Git tricks.
== Source Releases ==
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:
$ git-archive --format=tar --prefix=proj-1.2.3/ HEAD
== Changelog Generation ==
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
$ git-log > ChangeLog
== Git Over SSH, HTTP ==
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.
Create a repository in your web directory:
$ GIT_DIR=proj.git git-init
and in the "proj.git" directory, run
$ git --bare update-server-info
$ chmod a+x hooks/post-update
From your computer, you can push via ssh:
$ git push web.server:/path/to/proj.git HEAD
and people can get your project via
$ git clone http://web.server/proj.git
== Commit What Changed ==
Telling Git when you've added, deleted and renamed files gets tedious. Instead, try:
$ git-ls-files -d -m -o | xargs git-update-index --add --remove
and Git will look at the files in the current directory and work everything out for itself.
You might want it to ignore particular files:
$ git-ls-files -d -m -o -x *.tmp | xargs git-update-index --add --remove
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:
$ git-ls-files -d -m -o -X ignore | xargs git-update-index --add --remove
== Building On Git ==
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.
See [[http://git.or.cz/][the Git homepage]] for some examples.