Skip to content

Commit c14261e

Browse files
Nicolas PitreJunio C Hamano
authored andcommitted
some doc updates
1) talk about "git merge" instead of "git pull ." 2) suggest "git repo-config" instead of directly editing config files 3) echo "URL: blah" > .git/remotes/foo is obsolete and should be "git repo-config remote.foo.url blah" 4) support for partial URL prefix has been removed (see commit ea560e6) so drop mention of it. Signed-off-by: Nicolas Pitre <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent adb7ba6 commit c14261e

File tree

5 files changed

+29
-49
lines changed

5 files changed

+29
-49
lines changed

Documentation/core-tutorial.txt

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,46 +1129,26 @@ juggle multiple lines of development simultaneously. Of
11291129
course, you will pay the price of more disk usage to hold
11301130
multiple working trees, but disk space is cheap these days.
11311131

1132-
[NOTE]
1133-
You could even pull from your own repository by
1134-
giving '.' as <remote-repository> parameter to `git pull`. This
1135-
is useful when you want to merge a local branch (or more, if you
1136-
are making an Octopus) into the current branch.
1137-
11381132
It is likely that you will be pulling from the same remote
11391133
repository from time to time. As a short hand, you can store
1140-
the remote repository URL in a file under .git/remotes/
1141-
directory, like this:
1142-
1143-
------------------------------------------------
1144-
$ mkdir -p .git/remotes/
1145-
$ cat >.git/remotes/linus <<\EOF
1146-
URL: http://www.kernel.org/pub/scm/git/git.git/
1147-
EOF
1148-
------------------------------------------------
1149-
1150-
and use the filename to `git pull` instead of the full URL.
1151-
The URL specified in such file can even be a prefix
1152-
of a full URL, like this:
1134+
the remote repository URL in the local repository's config file
1135+
like this:
11531136

11541137
------------------------------------------------
1155-
$ cat >.git/remotes/jgarzik <<\EOF
1156-
URL: http://www.kernel.org/pub/scm/linux/git/jgarzik/
1157-
EOF
1138+
$ git repo-config remote.linus.url http://www.kernel.org/pub/scm/git/git.git/
11581139
------------------------------------------------
11591140

1141+
and use the "linus" keyword with `git pull` instead of the full URL.
11601142

11611143
Examples.
11621144

11631145
. `git pull linus`
11641146
. `git pull linus tag v0.99.1`
1165-
. `git pull jgarzik/netdev-2.6.git/ e100`
11661147

11671148
the above are equivalent to:
11681149

11691150
. `git pull http://www.kernel.org/pub/scm/git/git.git/ HEAD`
11701151
. `git pull http://www.kernel.org/pub/scm/git/git.git/ tag v0.99.1`
1171-
. `git pull http://www.kernel.org/pub/.../jgarzik/netdev-2.6.git e100`
11721152

11731153

11741154
How does the merge work?
@@ -1546,7 +1526,8 @@ on that project and has an own "public repository" goes like this:
15461526

15471527
1. Prepare your work repository, by `git clone` the public
15481528
repository of the "project lead". The URL used for the
1549-
initial cloning is stored in `.git/remotes/origin`.
1529+
initial cloning is stored in the remote.origin.url
1530+
configuration variable.
15501531

15511532
2. Prepare a public repository accessible to others, just like
15521533
the "project lead" person does.
@@ -1586,14 +1567,15 @@ like this:
15861567
1. Prepare your work repository, by `git clone` the public
15871568
repository of the "project lead" (or a "subsystem
15881569
maintainer", if you work on a subsystem). The URL used for
1589-
the initial cloning is stored in `.git/remotes/origin`.
1570+
the initial cloning is stored in the remote.origin.url
1571+
configuration variable.
15901572

15911573
2. Do your work in your repository on 'master' branch.
15921574

15931575
3. Run `git fetch origin` from the public repository of your
15941576
upstream every once in a while. This does only the first
15951577
half of `git pull` but does not merge. The head of the
1596-
public repository is stored in `.git/refs/heads/origin`.
1578+
public repository is stored in `.git/refs/remotes/origin/master`.
15971579

15981580
4. Use `git cherry origin` to see which ones of your patches
15991581
were accepted, and/or use `git rebase origin` to port your
@@ -1681,11 +1663,11 @@ $ git reset --hard master~2
16811663

16821664
You can make sure 'git show-branch' matches the state before
16831665
those two 'git merge' you just did. Then, instead of running
1684-
two 'git merge' commands in a row, you would pull these two
1666+
two 'git merge' commands in a row, you would merge these two
16851667
branch heads (this is known as 'making an Octopus'):
16861668

16871669
------------
1688-
$ git pull . commit-fix diff-fix
1670+
$ git merge commit-fix diff-fix
16891671
$ git show-branch
16901672
! [commit-fix] Fix commit message normalization.
16911673
! [diff-fix] Fix rename detection.
@@ -1701,7 +1683,7 @@ $ git show-branch
17011683

17021684
Note that you should not do Octopus because you can. An octopus
17031685
is a valid thing to do and often makes it easier to view the
1704-
commit history if you are pulling more than two independent
1686+
commit history if you are merging more than two independent
17051687
changes at the same time. However, if you have merge conflicts
17061688
with any of the branches you are merging in and need to hand
17071689
resolve, that is an indication that the development happened in

Documentation/everyday.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ modification will be caught if you do `git commit -a` later.
148148
<8> redo the commit undone in the previous step, using the message
149149
you originally wrote.
150150
<9> switch to the master branch.
151-
<10> merge a topic branch into your master branch. You can also use
152-
`git pull . alsa-audio`, i.e. pull from the local repository.
151+
<10> merge a topic branch into your master branch.
153152
<11> review commit logs; other forms to limit output can be
154153
combined and include `\--max-count=10` (show 10 commits),
155154
`\--until=2005-12-10`, etc.

Documentation/git-pull.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ git pull origin next::
5252

5353
git pull . fixes enhancements::
5454
Bundle local branch `fixes` and `enhancements` on top of
55-
the current branch, making an Octopus merge.
55+
the current branch, making an Octopus merge. This `git pull .`
56+
syntax is equivalent to `git merge`.
5657

5758
git pull -s ours . obsolete::
5859
Merge local branch `obsolete` into the current branch,

Documentation/git-rerere.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ One way to do it is to pull master into the topic branch:
8181

8282
------------
8383
$ git checkout topic
84-
$ git pull . master
84+
$ git merge master
8585

8686
o---*---o---+ topic
8787
/ /
@@ -103,10 +103,10 @@ in which case the final commit graph would look like this:
103103

104104
------------
105105
$ git checkout topic
106-
$ git pull . master
106+
$ git merge master
107107
$ ... work on both topic and master branches
108108
$ git checkout master
109-
$ git pull . topic
109+
$ git merge topic
110110

111111
o---*---o---+---o---o topic
112112
/ / \
@@ -126,11 +126,11 @@ top of the tip before the test merge:
126126

127127
------------
128128
$ git checkout topic
129-
$ git pull . master
129+
$ git merge master
130130
$ git reset --hard HEAD^ ;# rewind the test merge
131131
$ ... work on both topic and master branches
132132
$ git checkout master
133-
$ git pull . topic
133+
$ git merge topic
134134

135135
o---*---o-------o---o topic
136136
/ \

Documentation/tutorial.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ diff" with:
1111
$ man git-diff
1212
------------------------------------------------
1313

14-
It is a good idea to introduce yourself to git before doing any
15-
operation. The easiest way to do so is:
14+
It is a good idea to introduce yourself to git with your name and
15+
public email address before doing any operation. The easiest
16+
way to do so is:
1617

1718
------------------------------------------------
18-
$ cat >~/.gitconfig <<\EOF
19-
[user]
20-
name = Your Name Comes Here
21-
22-
EOF
19+
$ git repo-config --global user.name "Your Name Comes Here"
20+
$ git repo-config --global user.email [email protected]
2321
------------------------------------------------
2422

2523

@@ -211,7 +209,7 @@ at this point the two branches have diverged, with different changes
211209
made in each. To merge the changes made in experimental into master, run
212210

213211
------------------------------------------------
214-
$ git pull . experimental
212+
$ git merge experimental
215213
------------------------------------------------
216214

217215
If the changes don't conflict, you're done. If there are conflicts,
@@ -316,14 +314,14 @@ shows a list of all the changes that Bob made since he branched from
316314
Alice's master branch.
317315

318316
After examining those changes, and possibly fixing things, Alice
319-
could pull the changes into her master branch:
317+
could merge the changes into her master branch:
320318

321319
-------------------------------------
322320
$ git checkout master
323-
$ git pull . bob-incoming
321+
$ git merge bob-incoming
324322
-------------------------------------
325323

326-
The last command is a pull from the "bob-incoming" branch in Alice's
324+
The last command is a merge from the "bob-incoming" branch in Alice's
327325
own repository.
328326

329327
Alice could also perform both steps at once with:

0 commit comments

Comments
 (0)