I’m certain that I’m missing something fundamental here, but I’ve received a drop of an application stored in a git repository. It has folders like: branches, hooks, objects, etc, but no actual source files.
When I open up git bash and cd into that folder, the title says “(BARE:master)”.
I assume I just need to somehow clone a local reposisitory from that folder. Ultimately, I just need access to the actual source files in the repository, but I’m surely missing some concept as I’m somewhat new to git.
Any hints or help on how I can get this set up locally would be appreciated.
edit: when I try to clone from that directory I receive the following error
$ git clone c:/Users/Joel/Dropbox/TheProjectDirectory.git
Cloning into LocalProjectFolder ...
fatal: 'c:/Users/Joel/Dropbox/TheProjectDirectory.git' does not appear to be a git
repository
fatal: The remote end hung up unexpectedly
It is bare repository what you have.
The simplest way to get sources is to clone it via
git clone /path/to/your/bare/repThe bare repositories is something like shared repository, where work from several developers get gathered. For developer box you most probably want non-bare one.
There’s a chapter about cloning repositories.
EDIT:
So, I have some git repository on my box. So I’ll try to emulate your situation. First I’ll clone my repository as bare one:
So here I have bare.git repository like you have your shared folder. Now I will clone it to have some working directory with actual sources:
Now I have folder
my-non-bare-dev-repand all files from repository are there. It is you working copy. String(master)is the hint for you that you are in themasterbranch now.Then I’ll emulate some work in my working copy.
I want to see changes I have in working copy comparing with the version I got from shared rep:
Now I will add this text file to so-called stage area (or sometimes it is called index). It is the term to describe a set of changes that will be committed when
git commitcommand is executed.Well now text-file.txt is in the stage area. But it is still not committed. It is time to do this:
So. Now it is stored in my local repository. In the
.gitfolder actually. But it is still not went to shared repo so that my colleagues also see it. For this I need to do apush:originis a standard name git gives to parent when you did a clone. So as I did clone from bare.git – my changes just went there.And finally to get updates from shared folder into your local repository you have to execute
pullcommand:I don’t have any changes pushed to bare.git from other places, so my local rep is up-to-date. And git told me so.