I'm sorry if this is covered elsewhere, but I can't find the answer.
I have a bare repo, called bare.git which is the repository from which are cloned the dev repos. It all works well.
I want to know where bare.git gets the source files from. Are they stored as binary files inside the bare.git file structure? I can move bare.git to another location and still clone repos out of it, so the source must, in some way, be portable. Or is it storing absolute network references to the files?
There are three main reasons I want o know this information:
The correct answer is to do a: git clone --mirror [email protected]/your-repo. git This will copy your entire repository, notes, branches, tracking, etc.
You shouldn't store credentials like usernames, passwords, API keys and API secrets. If someone else steals your credentials, they can do nasty things with it.
Git bare clone Just use the –bare switch with the git clone command and you will have a Git repository without a working tree.
A git repository can be safely copied to an other directory, or put in an archive file. This is a very basic way of keeping a backup of your repo. cp -r myrepo backup_copy tar -czf backup_copy.tgz myrepo. But such a frozen copy can not be updated.
Your source files are stored as a part of the index inside of bare.git file structure, which is same as you have in .git directory in any of your clones.
So, it's best to backup full bare.git.
You may get current version for testing by cloning your bare repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With