When working in a large IT department, there are times when you feel a bit like a Blue Peter presenter.
For example, there may be a requirement to colloborate with other programmers on a project but, for whatever reason, you do not have access to a hosting platform ( Github, Bitbucket, Gitlab – pick you’re favourite).
What you do have is a network share to which you all have access, and Git installed locally on each of your machines.
This can be thought of as the technical equivalent of an empty washing-up bottle, a couple of loo rolls and some sticky back plastic.
Fortunately, this represents the raw materials required to construct a Tracey Island or – in this case – a Bare Git Repo to act as the main repository for the project…
The Repository we want to share looks like this :
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/blue_peter_project.png)
To create the main repository on the share, we can open a command window and create the directory to hold the repository on the share ( which is mapped to Z:\ in my case) :
mkdir z:\blue_peter
…then navigate to the new directory and create a Bare Repo …
git init --bare
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/init_bare.png)
You can then populate the repo with the existing project.
git remote add origin z:\blue_peter
git push origin main
NOTE – it could be because I was doing this on a VM, but when I first ran the push, I got an error about the ownership of the shared directory :
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/dubious_ownership.png?w=899)
This can be solved by running :
git config --global --add safe.directory z:blue_peter
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/push_success.png?w=904)
Looking at the files in our new main repo, we can see that it’s not shown as individual files, as you’d expect in a normal repo :
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/bare_contents.png?w=923)
However, we can access the contents via Git in the normal way.
For example, I can now clone the repository to a different location. In real-life this would be a completely different client, but I’ve run out of VMs !
git clone z:\blue_peter
Side Note – Once again, I hit the dubious ownership issue :
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/clone_from_bare.png?w=984)
Anyhow, we can see the files as usual in the cloned repo :
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/cloned_files.png?w=1022)
…and the repository now behaves as expected. If we make a change and push it…
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/change_push1.png?w=1022)
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/change_push2.png?w=1024)
We can pull the repo in another “client” :
![](https://mikesmithers.wordpress.com/wp-content/uploads/2024/06/pull_updated.png?w=897)
After all that, I think you’ve earned a Blue Peter Badge.