threads / discuss / 47112

git, isolation

Subject: git, isolation

## tl;dr

3 messages between Nov 3, 2017 and Nov 3, 2017.

replies: 2people: 3as markdown or json

Péter· Nov 3, 2017, 16:33 UTC · lore
Hi,

If I do a "git commit", issue git operations, and at the end, issue a "rm <the_git_dir>", is there any guarantee that my filesystem will be "clean", i.e. not polluted or otherwise modified by some git command? Are the git operations restricted to the repo-directory (and possibly remote places, over network)? Do the git-directory behaves as it were chroot-ed or be a sandbox? (Yet another words: is the git-directory isolated from the rest of the local filesystem (and packaging system)?)

Péter
Dennis Kaarsemaker· Nov 3, 2017, 16:52 UTC · re: Péter · lore

Re: git, isolation

On Fri, 2017-11-03 at 17:33 +0100, Péter wrote:
> Hi,
> 
> If I do a "git commit", issue git operations, and at the end, issue a "rm <the_git_dir>", is there any guarantee that my 
> filesystem will be "clean", 
No.
> i.e. not polluted or otherwise modified by some git command? Are the git operations 
> restricted to the repo-directory (and possibly remote places, over network)? 
No.
> Do the git-directory behaves as it were 
> chroot-ed or be a sandbox? (Yet another words: is the git-directory isolated from the rest of the local filesystem (and 
> packaging system)?)
And no :)

Most git commands will not touch anything outside the main worktree and the .git directory in there, but commands like 'git worktree' can be used to create worktrees anywhere in the filesystem, and when you play tricks with the GIT_WORK_TREE environment variable, you can do other nasty things.

D.
Stefan Beller· Nov 3, 2017, 17:18 UTC · re: Dennis Kaarsemaker · lore

Re: git, isolation

On Fri, Nov 3, 2017 at 9:52 AM, Dennis Kaarsemaker <dennis@kaarsemaker.net> wrote:

Show 24 quoted lines
> On Fri, 2017-11-03 at 17:33 +0100, Péter wrote:
>> Hi,
>>
>> If I do a "git commit", issue git operations, and at the end, issue a "rm <the_git_dir>", is there any guarantee that my
>> filesystem will be "clean",
>
> No.
>
>> i.e. not polluted or otherwise modified by some git command? Are the git operations
>> restricted to the repo-directory (and possibly remote places, over network)?
>
> No.
>
>> Do the git-directory behaves as it were
>> chroot-ed or be a sandbox? (Yet another words: is the git-directory isolated from the rest of the local filesystem (and
>> packaging system)?)
>
> And no :)
>
> Most git commands will not touch anything outside the main worktree and
> the .git directory in there, but commands like 'git worktree' can be
> used to create worktrees anywhere in the filesystem, and when you play
> tricks with the GIT_WORK_TREE environment variable, you can do other
> nasty things.
Or a more common thing, implemented earlier in Gits career:
  git config --global ....

← back to recent threads