0

I need a bare repository that I publish to using VS2015. However, my publishing fails because there is already a "config" file created with the --bare command. This file is web.config I assume.

I confirmed this by trying to just paste the files from the publish directory into the bare repository. Still won't work.

If I try to use git init --bare inside the directory (if the published files are present), it fails saying there is an error with config file.

How is this handled?

REMESQ
  • 1,080
  • 2
  • 26
  • 58

1 Answers1

1

The flow should be as follows:

mkdir myrepo
cd myrepo
git init --bare

Then you configure the repo as a remote in your IDE and push to it.

Configuring access to the repo and the IDE will vary based on the git backend and the IDE.

As the errors indicate, a bare repo is not the same beast as a regular repo. It has a special file structure that only tracks the changes and doesn't include the files themselves in a human recognizable format.

It's essentially just the .git part of your regular repo directory, so existing files and regular files will cause errors.

  • hmmm, I was thinking not to even push files to it presuming I would get the same error. Is that not the case? If so, then the answer would be to push to it and I won't have this problem? Thanks, new to git. – REMESQ May 11 '16 at 04:41
  • 1
    yep, it populates the bare repo with your pushes. Totally different animal, and what differentiates it from rsync. – Jason Lee Eaton May 11 '16 at 04:43