# git, isolation

3 messages from 2017-11-03 to 2017-11-03. Participants: Péter, Dennis Kaarsemaker, Stefan Beller.
Thread: https://gitlist.dev/t/47112

## Péter, 2017-11-03 16:33

Subject: git, isolation
Message-ID: <9f514a9b-858c-9f3a-e2d4-a45987a19b9a@prolan-power.hu>
URL: https://gitlist.dev/e/9f514a9b-858c-9f3a-e2d4-a45987a19b9a%40prolan-power.hu

```
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, 2017-11-03 16:52

Subject: Re: git, isolation
Message-ID: <1509727946.1734.2.camel@kaarsemaker.net>
URL: https://gitlist.dev/e/1509727946.1734.2.camel%40kaarsemaker.net
In-Reply-To: <9f514a9b-858c-9f3a-e2d4-a45987a19b9a@prolan-power.hu>

```
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, 2017-11-03 17:18

Subject: Re: git, isolation
Message-ID: <CAGZ79kar+YbMyMK-ktOT3WZW5fZB89HL1QabsZAhofcGuSJSbg@mail.gmail.com>
URL: https://gitlist.dev/e/CAGZ79kar%2BYbMyMK-ktOT3WZW5fZB89HL1QabsZAhofcGuSJSbg%40mail.gmail.com
In-Reply-To: <1509727946.1734.2.camel@kaarsemaker.net>

```
On Fri, Nov 3, 2017 at 9:52 AM, Dennis Kaarsemaker
<dennis@kaarsemaker.net> wrote:
> 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 ....

```
