1
Everyday GIT With 20 Commands Or So
2
===================================
3
4
-<<Basic Repository>> commands are needed by people who have a
5
-repository --- that is everybody, because every working tree of
6
-git is a repository.
7
-
8
-In addition, <<Individual Developer (Standalone)>> commands are
9
-essential for anybody who makes a commit, even for somebody who
10
-works alone.
4
+<<Individual Developer (Standalone)>> commands are essential for
5
+anybody who makes a commit, even for somebody who works alone.
6
7
If you work with other people, you will need commands listed in
8
the <<Individual Developer (Participant)>> section as well.
15
of git repositories.
16
17
23
-Basic Repository[[Basic Repository]]
24
-------------------------------------
25
-
26
-Everybody uses these commands to maintain git repositories.
27
-
28
- * linkgit:git-init[1] or linkgit:git-clone[1] to create a
29
- new repository.
30
-
31
- * linkgit:git-fsck[1] to check the repository for errors.
32
-
33
- * linkgit:git-gc[1] to do common housekeeping tasks such as
34
- repack and prune.
35
-
36
-Examples
37
-~~~~~~~~
38
-
39
-Check health and remove cruft.::
40
-+
41
-------------
42
-$ git fsck <1>
43
-$ git count-objects <2>
44
-$ git gc <3>
45
-------------
46
-+
47
-<1> running without `\--full` is usually cheap and assures the
48
-repository health reasonably well.
49
-<2> check how many loose objects there are and how much
50
-disk space is wasted by not repacking.
51
-<3> repacks the local repository and performs other housekeeping tasks.
52
-
53
-Repack a small project into single pack.::
54
-+
55
-------------
56
-$ git gc <1>
57
-------------
58
-+
59
-<1> pack all the objects reachable from the refs into one pack,
60
-then remove the other packs.
61
-
62
-
18
Individual Developer (Standalone)[[Individual Developer (Standalone)]]
19
----------------------------------------------------------------------
20
22
other people, and works alone in a single repository, using the
23
following commands.
24
25
+ * linkgit:git-init[1] to create a new repository.
26
+
27
* linkgit:git-show-branch[1] to see where you are.
28
29
* linkgit:git-log[1] to see what happened.