Question: When a repository is cloned by using simple `git clone repo`, the master branch is automatically checked out. If after this automatic checkout, I want to delete all files checked out and turn the clone in to a bare clone, how can I achieve this? Are there configurations within the .git folder that I can modify to accomplish this?

Side note: ~~I know that specifying the `--no-checkout` or `-n` flag during clone prevents checkout of `HEAD` and keeps the repository bare.~~ If I delete the files that are checked out, those files will be shown as deleted when running `git status`.

Answer: 
`git clone --no-checkout` doesn't give a bare repository, it just leaves the work tree and index empty. `git status` after such a clone will say that all files have been staged for deletion.

A bare repository is one with `core.bare = true` (and a bare repository made with `git clone --bare` will also not have any remote refs). You can do `git config core.bare true` to flip this bit. Then remove the work tree and index, and possibly rename the directory from `repo/.git` to `repo.git`.
I don't get your question.

In my understanding, if you want to clear a repository then after cloning delete the files you don't want and push.

If you want to checkout into a new branch then use this command:

```
git checkout -b your-new-branch-name

```