Skip to content

Commit 50caafb

Browse files
JanecekPetrPetr Janecek
authored andcommitted
(#1395) Partial globbing is available in refspec since git 2.6.0
Motivation The docs were saying that partial glob patterns are unavailable in refspec, and namespacing is the only way to get flexible refspecs matching multiple branches. This is no longer true since Git 2.6.0 which added support for partial globbing patterns. Modifications The outdated paragraph was changed so that it now explicitly states that the approach works. Closes #1395.
1 parent 1b66cc4 commit 50caafb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/10-git-internals/sections/refspec.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ If you want to always fetch the `master` and `experiment` branches from the `ori
7575
fetch = +refs/heads/experiment:refs/remotes/origin/experiment
7676
----
7777

78-
You can't use partial globs in the pattern, so this would be invalid:
78+
Since Git 2.6.0 you can use partial globs in the pattern to match multiple branches, so this works:
7979

8080
[source,ini]
8181
----
8282
fetch = +refs/heads/qa*:refs/remotes/origin/qa*
8383
----
8484

85-
However, you can use namespaces (or directories) to accomplish something like that.
85+
Even better, you can use namespaces (or directories) to accomplish the same with more structure.
8686
If you have a QA team that pushes a series of branches, and you want to get the `master` branch and any of the QA team's branches but nothing else, you can use a config section like this:
8787

8888
[source,ini]

0 commit comments

Comments
 (0)