@@ -1129,46 +1129,26 @@ juggle multiple lines of development simultaneously. Of
1129
1129
course, you will pay the price of more disk usage to hold
1130
1130
multiple working trees, but disk space is cheap these days.
1131
1131
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
-
1138
1132
It is likely that you will be pulling from the same remote
1139
1133
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:
1153
1136
1154
1137
------------------------------------------------
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/
1158
1139
------------------------------------------------
1159
1140
1141
+ and use the "linus" keyword with `git pull` instead of the full URL.
1160
1142
1161
1143
Examples.
1162
1144
1163
1145
. `git pull linus`
1164
1146
. `git pull linus tag v0.99.1`
1165
- . `git pull jgarzik/netdev-2.6.git/ e100`
1166
1147
1167
1148
the above are equivalent to:
1168
1149
1169
1150
. `git pull http://www.kernel.org/pub/scm/git/git.git/ HEAD`
1170
1151
. `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`
1172
1152
1173
1153
1174
1154
How does the merge work?
@@ -1546,7 +1526,8 @@ on that project and has an own "public repository" goes like this:
1546
1526
1547
1527
1. Prepare your work repository, by `git clone` the public
1548
1528
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.
1550
1531
1551
1532
2. Prepare a public repository accessible to others, just like
1552
1533
the "project lead" person does.
@@ -1586,14 +1567,15 @@ like this:
1586
1567
1. Prepare your work repository, by `git clone` the public
1587
1568
repository of the "project lead" (or a "subsystem
1588
1569
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.
1590
1572
1591
1573
2. Do your work in your repository on 'master' branch.
1592
1574
1593
1575
3. Run `git fetch origin` from the public repository of your
1594
1576
upstream every once in a while. This does only the first
1595
1577
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 `.
1597
1579
1598
1580
4. Use `git cherry origin` to see which ones of your patches
1599
1581
were accepted, and/or use `git rebase origin` to port your
@@ -1681,11 +1663,11 @@ $ git reset --hard master~2
1681
1663
1682
1664
You can make sure 'git show-branch' matches the state before
1683
1665
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
1685
1667
branch heads (this is known as 'making an Octopus'):
1686
1668
1687
1669
------------
1688
- $ git pull . commit-fix diff-fix
1670
+ $ git merge commit-fix diff-fix
1689
1671
$ git show-branch
1690
1672
! [commit-fix] Fix commit message normalization.
1691
1673
! [diff-fix] Fix rename detection.
@@ -1701,7 +1683,7 @@ $ git show-branch
1701
1683
1702
1684
Note that you should not do Octopus because you can. An octopus
1703
1685
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
1705
1687
changes at the same time. However, if you have merge conflicts
1706
1688
with any of the branches you are merging in and need to hand
1707
1689
resolve, that is an indication that the development happened in
0 commit comments