Skip to content

Commit 76f3a08

Browse files
authored
Update GettingStarted.rst doc with negative refspec to filter user branches (llvm#75015)
This allows to keep fetching release branches as well.
1 parent d73c2d5 commit 76f3a08

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/docs/GettingStarted.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ Getting the Source Code and Building LLVM
4242

4343
``git clone --depth 1 https://github.com/llvm/llvm-project.git``
4444

45-
* You are likely only interested in the main branch moving forward, if
46-
you don't want `git fetch` (or `git pull`) to download user branches, use:
45+
* You are likely not interested in the user branches in the repo (used for
46+
stacked pull-requests and reverts), you can filter them from your
47+
`git fetch` (or `git pull`) with this configuration:
4748

48-
``sed 's#fetch = +refs/heads/\*:refs/remotes/origin/\*#fetch = +refs/heads/main:refs/remotes/origin/main#' -i llvm-project/.git/config``
49+
.. code-block:: console
50+
51+
git config --add remote.origin.fetch '^refs/heads/users/*'
52+
git config --add remote.origin.fetch '^refs/heads/revert-*'
4953
5054
#. Configure and build LLVM and Clang:
5155

0 commit comments

Comments
 (0)