[llvm] Update GettingStarted.rst doc with negative refspec to filter user branches (PR #75015)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 14:39:23 PDT 2024


https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/75015

>From dc1f274a26285bfe0bf3beb72b885e2f2ad3b74e Mon Sep 17 00:00:00 2001
From: Mehdi Amini <joker.eph at gmail.com>
Date: Sun, 10 Dec 2023 18:11:38 -0800
Subject: [PATCH] Update GettingStarted.rst doc with negative refspec to filter
 user branches

---
 llvm/docs/GettingStarted.rst | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst
index da9cc8aea6d32d..c449edfdc73f4a 100644
--- a/llvm/docs/GettingStarted.rst
+++ b/llvm/docs/GettingStarted.rst
@@ -40,10 +40,14 @@ Getting the Source Code and Building LLVM
 
      ``git clone --depth 1 https://github.com/llvm/llvm-project.git``
 
-   * You are likely only interested in the main branch moving forward, if
-     you don't want `git fetch` (or `git pull`) to download user branches, use:
+   * You are likely not interested in the user branches in the repo (used for
+     stacked pull-requests and reverts), you can filter them from your
+     `git fetch` (or `git pull`) with this configuration:
 
-     ``sed 's#fetch = +refs/heads/\*:refs/remotes/origin/\*#fetch = +refs/heads/main:refs/remotes/origin/main#' -i llvm-project/.git/config``
+.. code-block:: console
+
+  git config --add remote.origin.fetch '^refs/heads/users/*'
+  git config --add remote.origin.fetch '^refs/heads/revert-*'
 
 #. Configure and build LLVM and Clang:
 



More information about the llvm-commits mailing list