@@ -42,10 +42,9 @@ How to get a git repository
42
42
It will be useful to have a git repository to experiment with as you
43
43
read this manual.
44
44
45
- The best way to get one is by using the gitlink:git-clone[1] command
46
- to download a copy of an existing repository for a project that you
47
- are interested in. If you don't already have a project in mind, here
48
- are some interesting examples:
45
+ The best way to get one is by using the gitlink:git-clone[1] command to
46
+ download a copy of an existing repository. If you don't already have a
47
+ project in mind, here are some interesting examples:
49
48
50
49
------------------------------------------------
51
50
# git itself (approx. 10MB download):
@@ -63,21 +62,18 @@ directory, you will see that it contains a copy of the project files,
63
62
together with a special top-level directory named ".git", which
64
63
contains all the information about the history of the project.
65
64
66
- In most of the following, examples will be taken from one of the two
67
- repositories above.
68
-
69
65
[[how-to-check-out]]
70
66
How to check out a different version of a project
71
67
-------------------------------------------------
72
68
73
- Git is best thought of as a tool for storing the history of a
74
- collection of files. It stores the history as a compressed
75
- collection of interrelated snapshots (versions) of the project's
76
- contents .
69
+ Git is best thought of as a tool for storing the history of a collection
70
+ of files. It stores the history as a compressed collection of
71
+ interrelated snapshots of the project's contents. In git each such
72
+ version is called a <<def_commit,commit>> .
77
73
78
74
A single git repository may contain multiple branches. It keeps track
79
75
of them by keeping a list of <<def_head,heads>> which reference the
80
- latest version on each branch; the gitlink:git-branch[1] command shows
76
+ latest commit on each branch; the gitlink:git-branch[1] command shows
81
77
you the list of branch heads:
82
78
83
79
------------------------------------------------
@@ -149,32 +145,27 @@ current branch:
149
145
150
146
------------------------------------------------
151
147
$ git show
152
- commit 2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2
153
- Author: Jamal Hadi Salim <
[email protected] >
154
- Date: Sat Dec 2 22:22:25 2006 -0800
155
-
156
- [XFRM]: Fix aevent structuring to be more complete.
157
-
158
- aevents can not uniquely identify an SA. We break the ABI with this
159
- patch, but consensus is that since it is not yet utilized by any
160
- (known) application then it is fine (better do it now than later).
161
-
162
- Signed-off-by: Jamal Hadi Salim <
[email protected] >
163
- Signed-off-by: David S. Miller <
[email protected] >
164
-
165
- diff --git a/Documentation/networking/xfrm_sync.txt b/Documentation/networking/xfrm_sync.txt
166
- index 8be626f..d7aac9d 100644
167
- --- a/Documentation/networking/xfrm_sync.txt
168
- +++ b/Documentation/networking/xfrm_sync.txt
169
- @@ -47,10 +47,13 @@ aevent_id structure looks like:
170
-
171
- struct xfrm_aevent_id {
172
- struct xfrm_usersa_id sa_id;
173
- + xfrm_address_t saddr;
174
- __u32 flags;
175
- + __u32 reqid;
176
- };
177
- ...
148
+ commit 17cf781661e6d38f737f15f53ab552f1e95960d7
149
+ Author: Linus Torvalds <
[email protected] .(none)>
150
+ Date: Tue Apr 19 14:11:06 2005 -0700
151
+
152
+ Remove duplicate getenv(DB_ENVIRONMENT) call
153
+
154
+ Noted by Tony Luck.
155
+
156
+ diff --git a/init-db.c b/init-db.c
157
+ index 65898fa..b002dc6 100644
158
+ --- a/init-db.c
159
+ +++ b/init-db.c
160
+ @@ -7,7 +7,7 @@
161
+
162
+ int main(int argc, char **argv)
163
+ {
164
+ - char *sha1_dir = getenv(DB_ENVIRONMENT), *path;
165
+ + char *sha1_dir, *path;
166
+ int len, i;
167
+
168
+ if (mkdir(".git", 0755) < 0) {
178
169
------------------------------------------------
179
170
180
171
As you can see, a commit shows who made the latest change, what they
@@ -923,7 +914,7 @@ they look OK.
923
914
924
915
[[Finding-comments-with-given-content]]
925
916
Finding commits referencing a file with given content
926
- -----------------------------------------------------
917
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
927
918
928
919
Somebody hands you a copy of a file, and asks which commits modified a
929
920
file such that it contained the given content either before or after the
@@ -1105,20 +1096,14 @@ backup files made by your editor. Of course, 'not' tracking files with git
1105
1096
is just a matter of 'not' calling "`git add`" on them. But it quickly becomes
1106
1097
annoying to have these untracked files lying around; e.g. they make
1107
1098
"`git add .`" and "`git commit -a`" practically useless, and they keep
1108
- showing up in the output of "`git status`", etc .
1099
+ showing up in the output of "`git status`".
1109
1100
1110
- Git therefore provides "exclude patterns" for telling git which files to
1111
- actively ignore. Exclude patterns are thoroughly explained in the
1112
- gitlink:gitignore[5] manual page, but the heart of the concept is simply
1113
- a list of files which git should ignore. Entries in the list may contain
1114
- globs to specify multiple files, or may be prefixed by "`!`" to
1115
- explicitly include (un-ignore) a previously excluded (ignored) file
1116
- (i.e. later exclude patterns override earlier ones). The following
1117
- example should illustrate such patterns:
1101
+ You can tell git to ignore certain files by creating a file called .gitignore
1102
+ in the top level of your working directory, with contents such as:
1118
1103
1119
1104
-------------------------------------------------
1120
1105
# Lines starting with '#' are considered comments.
1121
- # Ignore foo.txt.
1106
+ # Ignore any file named foo.txt.
1122
1107
foo.txt
1123
1108
# Ignore (generated) html files,
1124
1109
*.html
@@ -1128,41 +1113,20 @@ foo.txt
1128
1113
*.[oa]
1129
1114
-------------------------------------------------
1130
1115
1131
- The next question is where to put these exclude patterns so that git can
1132
- find them. Git looks for exclude patterns in the following files:
1133
-
1134
- `.gitignore` files in your working tree:::
1135
- You may store multiple `.gitignore` files at various locations in your
1136
- working tree. Each `.gitignore` file is applied to the directory where
1137
- it's located, including its subdirectories. Furthermore, the
1138
- `.gitignore` files can be tracked like any other files in your working
1139
- tree; just do a "`git add .gitignore`" and commit. `.gitignore` is
1140
- therefore the right place to put exclude patterns that are meant to
1141
- be shared between all project participants, such as build output files
1142
- (e.g. `\*.o`), etc.
1143
- `.git/info/exclude` in your repo:::
1144
- Exclude patterns in this file are applied to the working tree as a
1145
- whole. Since the file is not located in your working tree, it does
1146
- not follow push/pull/clone like `.gitignore` can do. This is therefore
1147
- the place to put exclude patterns that are local to your copy of the
1148
- repo (i.e. 'not' shared between project participants), such as
1149
- temporary backup files made by your editor (e.g. `\*~`), etc.
1150
- The file specified by the `core.excludesfile` config directive:::
1151
- By setting the `core.excludesfile` config directive you can tell git
1152
- where to find more exclude patterns (see gitlink:git-config[1] for
1153
- more information on configuration options). This config directive
1154
- can be set in the per-repo `.git/config` file, in which case the
1155
- exclude patterns will apply to that repo only. Alternatively, you
1156
- can set the directive in the global `~/.gitconfig` file to apply
1157
- the exclude pattern to all your git repos. As with the above
1158
- `.git/info/exclude` (and, indeed, with git config directives in
1159
- general), this directive does not follow push/pull/clone, but remain
1160
- local to your repo(s).
1161
-
1162
- [NOTE]
1163
- In addition to the above alternatives, there are git commands that can take
1164
- exclude patterns directly on the command line. See gitlink:git-ls-files[1]
1165
- for an example of this.
1116
+ See gitlink:gitignore[5] for a detailed explanation of the syntax. You can
1117
+ also place .gitignore files in other directories in your working tree, and they
1118
+ will apply to those directories and their subdirectories. The `.gitignore`
1119
+ files can be added to your repository like any other files (just run `git add
1120
+ .gitignore` and `git commit`, as usual), which is convenient when the exclude
1121
+ patterns (such as patterns matching build output files) would also make sense
1122
+ for other users who clone your repository.
1123
+
1124
+ If you wish the exclude patterns to affect only certain repositories
1125
+ (instead of every repository for a given project), you may instead put
1126
+ them in a file in your repository named .git/info/exclude, or in any file
1127
+ specified by the `core.excludesfile` configuration variable. Some git
1128
+ commands can also take exclude patterns directly on the command line.
1129
+ See gitlink:gitignore[5] for the details.
1166
1130
1167
1131
[[how-to-merge]]
1168
1132
How to merge
0 commit comments