* No Checkout / Read Only config Flag
@ 2019-11-07 21:34 Ingo Wolf
2019-11-08 15:50 ` Konstantin Khomoutov
2019-11-08 16:08 ` Philip Oakley
0 siblings, 2 replies; 3+ messages in thread
From: Ingo Wolf @ 2019-11-07 21:34 UTC (permalink / raw)
To: Git List
Hi,
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: No Checkout / Read Only config Flag
2019-11-07 21:34 No Checkout / Read Only config Flag Ingo Wolf
@ 2019-11-08 15:50 ` Konstantin Khomoutov
2019-11-08 16:08 ` Philip Oakley
1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Khomoutov @ 2019-11-08 15:50 UTC (permalink / raw)
To: Ingo Wolf; +Cc: Git List
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>.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: No Checkout / Read Only config Flag
2019-11-07 21:34 No Checkout / Read Only config Flag Ingo Wolf
2019-11-08 15:50 ` Konstantin Khomoutov
@ 2019-11-08 16:08 ` Philip Oakley
1 sibling, 0 replies; 3+ messages in thread
From: Philip Oakley @ 2019-11-08 16:08 UTC (permalink / raw)
To: Ingo Wolf, Git List
On 07/11/2019 21:34, Ingo Wolf wrote:
> Hi,
>
> is there a readonly / no checkout flag in the git configs?
>
Not that I'm aware of, but the use-case isn't clear, and is perhaps
contrary to actually having a version management system
> I use Git to trace / Backup some worktrees and would like to prevent
> changing them accidentally with git.
>
How would such 'accidents' happen? What's the size of the worktree and
how do you do such an accidental commit?
I could see that if you are changing hundreds of files within a commit,
and only one or two files need preserved, then did a `git add -A` you
would include any changes to those one or two special files, which
needed special attention.
This feels similar but not quite the same as previous discussions about
'precious' files (the latter commonly being untracked/ignored, but
shouldn't be removed/cleaned).
Technology won't solve the human error modes..., though a clear use case
can help.
--
Philip
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-08 16:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 21:34 No Checkout / Read Only config Flag Ingo Wolf
2019-11-08 15:50 ` Konstantin Khomoutov
2019-11-08 16:08 ` Philip Oakley
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).