How to open repository produced by git clone --mirror
Asked Answered
C

1

6

I got a git repository which was produced (and later zipped) by running command git clone --mirror. I was wondering how can I open the project in a way I could start programming with it.

Package root looks like following:

max$ tree
.
├── HEAD
├── config
├── description
├── hooks
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
│   ├── post-update.sample
│   ├── pre-applypatch.sample
│   ├── pre-commit.sample
│   ├── pre-push.sample
│   ├── pre-rebase.sample
│   ├── pre-receive.sample
│   ├── prepare-commit-msg.sample
│   └── update.sample
├── info
│   └── exclude
├── objects
│   ├── info
│   └── pack
│       ├── pack-0357e8f849278dd87fa3f57757c32d2f4afde634.idx
│       └── pack-0357e8f849278dd87fa3f57757c32d2f4afde634.pack
├── packed-refs
└── refs
    ├── heads
    └── tags

8 directories, 17 files
Corey answered 22/11, 2018 at 14:27 Comment(0)
G
6

You could clone the repo; that's normally what you do with a bare repo (which includes repos created with --mirror): you place them in an accessible location and use them as a remote.

If you want to use this repo directly as a local, then you can use git worktree. What a bare repo is "missing" compared to local work repos is a default worktree, but you can still add worktrees to them. See https://git-scm.com/docs/git-worktree for documentation.

Graybill answered 22/11, 2018 at 14:35 Comment(1)
Just to clarify that git clone <path-to-mirrored-repo-directory> will use the mirror folder as a 'local remote' and clone it into a separate folder with the regular working tree files.Biff

© 2022 - 2024 — McMap. All rights reserved.