0

A colleague is setting up git on a Windows machine with a central, bare repository and multiple users. The bare repository has been created with the Administrator account. The users have been (for the moment) added to the Administrators group. Everything is on the same machine, so as far as I understand git, access between the central repository and the user clones is direct file access. If that understanding isn't correct, then that could be where our problem is.

Cloning the local user repositories worked fine, but when we try to push a change to the central repository, we get errors such as:

remote: error: couldn't set 'refs/heads/master'

The push fails as a result. My initial thought was that this was a permissions issue, and we've checked that the user accounts have full control for the "master" file, as well as everything else in the .git tree. The repository is marked as shared in the config file. I've searched for answers on this, and all of them have to do with Linux permissions, and we've applied those concepts to the Windows repository, but without any success.

We are not interested in setting up a Linux server; this is for a customer, and they are running everything on Windows. We would prefer to have simplicity of setup without using ssh or other transport mechanisms, so our focus is on making this work as it's currently set up.

What else can we try to fix and/or troubleshoot the problem?

goug
  • 2,294
  • 1
  • 11
  • 15
  • 1
    Possible duplicate of [Couldn't set refs/heads/master when commit](https://stackoverflow.com/questions/30809205/couldnt-set-refs-heads-master-when-commit) – Robert Sep 24 '19 at 17:47
  • https://stackoverflow.com/search?q=%5Bgit%5D+remote%3A+error%3A+couldn%27t+set+%27refs%2Fheads%2Fmaster%27 – phd Sep 24 '19 at 18:00
  • It does not appear to be a duplicate of the first one. As I said, we've already checked permissions. This is a new, bare repository so it's not corrupted. We've actually deleted it and started over, and it's still happening. The second comment is not useful. I've already done that search and reviewed answers that could potentially be relevant. – goug Sep 24 '19 at 18:24
  • @goug: general advice (for all stackoverflow postings): if you've researched the previous question, include a link to it and why it's not the answer (or "all of its answers are not the answer"). Specific to this question: the `remote:` in front of the message means that the error is coming from the server. Investigate what's happening on the server to see why *it* can't set refs/heads/master. (It's not at all clear to me why that would happen.) – torek Sep 24 '19 at 19:01
  • The server and client are the same machine. – goug Sep 24 '19 at 21:25
  • I am looking for people who have expertise with git on Windows. – goug Sep 24 '19 at 21:26

1 Answers1

0

The issue with this is because, as an initial setup to get started, we were having the users be members of the Administrators group and giving full control to Administrators in the central repository. However, that wasn't sufficient because, although the users were members of the Administrators group, they had not elevated their git commands (either by using an elevated Command Prompt or by running SourceTree as Administrator), so the permission was denied. Using the built-in Users group worked just fine instead.

goug
  • 2,294
  • 1
  • 11
  • 15