Skip to content

Commit bd6d2c8

Browse files
committed
fixed some broken links and added an initial git blame section
1 parent 00510b2 commit bd6d2c8

File tree

6 files changed

+45
-15
lines changed

6 files changed

+45
-15
lines changed

text/12a_Ignoring_Files/0_Ignoring_Files.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ in the top level of your working directory, with contents such as:
2424
See linkgit:gitignore[5] for a detailed explanation of the syntax. You can
2525
also place .gitignore files in other directories in your working tree, and they
2626
will apply to those directories and their subdirectories. The `.gitignore`
27-
files can be added to your repository like any other files (just run `git add
28-
.gitignore` and `git commit`, as usual), which is convenient when the exclude
27+
files can be added to your repository like any other files
28+
(just run `git add .gitignore` and `git commit`, as usual), which is convenient when the exclude
2929
patterns (such as patterns matching build output files) would also make sense
3030
for other users who clone your repository.
3131

text/21_Redoing_Git_Reset_and_Revert/0_ Redoing_Git_Reset_and_Revert.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ You can also revert an earlier change, for example, the next-to-last:
6363
In this case git will attempt to undo the old change while leaving
6464
intact any changes made since then. If more recent changes overlap
6565
with the changes to be reverted, then you will be asked to fix
66-
conflicts manually, just as in the case of <<resolving-a-merge,
67-
resolving a merge>>.
66+
conflicts manually, just as in the case of resolving a merge.
6867

6968
#### Fixing a mistake by modifying a commit ####
7069

text/22_Maintaining_Git_Gc_Prune_Fsck/0_ Maintaining_Git_Gc_Prune_Fsck.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ time. The most common warning by far is about "dangling" objects:
3333

3434
Dangling objects are not a problem. At worst they may take up a little
3535
extra disk space. They can sometimes provide a last-resort method for
36-
recovering lost work--see <<dangling-objects>> for details.
36+
recovering lost work.

text/23_Setting_Up_A_Public_Repo_Git_Http_Ssh_Gitosis/0_ Setting_Up_A_Public_Repo.markdown

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ This is the preferred method.
2121

2222
If someone else administers the server, they should tell you what
2323
directory to put the repository in, and what git:// URL it will appear
24-
at. You can then skip to the section
25-
"<<pushing-changes-to-a-public-repository,Pushing changes to a public
26-
repository>>", below.
24+
at.
2725

2826
Otherwise, all you need to do is start linkgit:git-daemon[1]; it will
2927
listen on port 9418. By default, it will allow access to any directory
@@ -56,10 +54,3 @@ Advertise the URL of proj.git. Anybody else should then be able to
5654
clone or pull from that URL, for example with a command line like:
5755

5856
$ git clone http://yourserver.com/~you/proj.git
59-
60-
(See also
61-
link:howto/setup-git-server-over-http.txt[setup-git-server-over-http]
62-
for a slightly more sophisticated setup using WebDAV which also
63-
allows pushing over http.)
64-
65-
(!!gitosis!!)

text/24_Creating_New_Empty_Branches/0_ Creating_New_Empty_Branches.markdown

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Creating New Empty Branches ##
22

3+
Ocasionally, you may want to keep branches in your repository that do not
4+
share an ancestor with your normal code. Some examples of this might be
5+
generated documentation or something along those lines. If you want to
6+
create a new branch head that does not use your current codebase as a
7+
parent, you can create an empty branch like this:
38

49
git symbolic-ref HEAD refs/heads/newbranch
510
rm .git/index
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
## Finding Issues - Git Blame ##
22

3+
The linkto:git-blame[1] command is really helpful for figuring out who changed
4+
which sections of a file. If you simple run 'git blame [filename]' you'll get
5+
an output of the entire file with the last commit sha, date and author for every
6+
line in the file.
7+
8+
$ git blame sha1_file.c
9+
...
10+
0fcfd160 (Linus Torvalds 2005-04-18 13:04:43 -0700 8) */
11+
0fcfd160 (Linus Torvalds 2005-04-18 13:04:43 -0700 9) #include "cache.h"
12+
1f688557 (Junio C Hamano 2005-06-27 03:35:33 -0700 10) #include "delta.h"
13+
a733cb60 (Linus Torvalds 2005-06-28 14:21:02 -0700 11) #include "pack.h"
14+
8e440259 (Peter Eriksen 2006-04-02 14:44:09 +0200 12) #include "blob.h"
15+
8e440259 (Peter Eriksen 2006-04-02 14:44:09 +0200 13) #include "commit.h"
16+
8e440259 (Peter Eriksen 2006-04-02 14:44:09 +0200 14) #include "tag.h"
17+
8e440259 (Peter Eriksen 2006-04-02 14:44:09 +0200 15) #include "tree.h"
18+
f35a6d3b (Linus Torvalds 2007-04-09 21:20:29 -0700 16) #include "refs.h"70f5d5d3 (Nicolas Pitre 2008-02-28 00:25:19 -0500 17) #include "pack-revindex.h"628522ec (Junio C Hamano 2007-12-29 02:05:47 -0800 18) #include "sha1-lookup.h"
19+
...
20+
21+
This is often helpful if a file had a line reverted or a mistake that broke
22+
the build to help you see who changed that line last.
23+
24+
You can also specify a start and end line for the blame:
25+
26+
$>git annotate -L 160,+10 sha1_file.c
27+
ace1534d (Junio C Hamano 2005-05-07 00:38:04 -0700 160)}
28+
ace1534d (Junio C Hamano 2005-05-07 00:38:04 -0700 161)
29+
0fcfd160 (Linus Torvalds 2005-04-18 13:04:43 -0700 162)/*
30+
0fcfd160 (Linus Torvalds 2005-04-18 13:04:43 -0700 163) * NOTE! This returns a statically allocate
31+
790296fd (Jim Meyering 2008-01-03 15:18:07 +0100 164) * careful about using it. Do an "xstrdup()
32+
0fcfd160 (Linus Torvalds 2005-04-18 13:04:43 -0700 165) * filename.
33+
ace1534d (Junio C Hamano 2005-05-07 00:38:04 -0700 166) *
34+
ace1534d (Junio C Hamano 2005-05-07 00:38:04 -0700 167) * Also note that this returns the location
35+
ace1534d (Junio C Hamano 2005-05-07 00:38:04 -0700 168) * SHA1 file can happen from any alternate
36+
d19938ab (Junio C Hamano 2005-05-09 17:57:56 -0700 169) * DB_ENVIRONMENT environment variable if i
37+

0 commit comments

Comments
 (0)