git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: No Checkout / Read Only config Flag

From
KKKonstantin Khomoutov <kostix@bswap.ru>
Date
Nov 8, 2019, 15:50 UTC
Message-ID
<20191108155037.rru2glzbdw4npnte@carbon>
In-Reply-To
<f3378b7b-c745-58db-55ed-c2c2a6818734@gmx.de>
On Thu, Nov 07, 2019 at 10:34:32PM +0100, Ingo Wolf wrote:
> is there a readonly / no checkout flag in the git configs?
> 
> I use Git to trace / Backup some worktrees and would like to prevent
> changing them accidentally with git.

There's so-called "sparse checkout" feature in Git: it allows the user to designate parts of the work tree hierarchy as uninteresting, and Git won't touch them unless told otherwise.

Please refer to the section "SPARSE CHECKOUT" in the git-read-tree manual page (run `git help read-tree`).

To cite the git-checkout manual page:
| --ignore-skip-worktree-bits
|   In sparse checkout mode, git checkout -- <paths> would update only
|   entries matched by <paths> and sparse patterns in
|   $GIT_DIR/info/sparse-checkout. This option ignores the sparse patterns
|   and adds back any files in <paths>.
Previous: Philip Oakley
Message 3 of 3 in “No Checkout / Read Only config Flag”
  1. Ingo WolfNov 7, 2019
  2. Philip OakleyNov 8, 2019
  3. Konstantin KhomoutovNov 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.