English 中文(简体)
Take ownership of Git repository
原标题:

I have a computer that points to two connected Git repositories. It s a web site, and the repos are on remote drives (on servers) that I have mapped in Windows. The live production site is on G:webroot, and the development site is on H:webroot with the live site as the source of the dev. So I make changes on Dev, test, commit, then push them to Live. I m using SourceTree as a Git GUI. (NOTE: assume I m getting specific terminology wrong here. I hope I m getting the point across okay.)

Now I have a new desktop computer. Specifically, I started with a laptop, but am moving my main Git setup to a desktop. (I will continue to use the laptop for other things. If I can figure out how to also access these repos from the laptop that would be gravy.)

I ve seen lots of Q/A that talks about moving the repository, and you either clone or just plain move the entire folder. But in my case, I m not moving the repos at all, I m just trying to get SourceTree to connect me properly to the existing ones. I did copy over the Atlassian folders from %appdata%, and that may have been my mistake -- not sure.

If I enter the path as a local repo, I get the following:

git status failed with code 128: fatal: detected dubious ownership of repository at " (path).

It talks about adding an exception to my Git config, but I don t really understand what that would actually be doing, or if it s the right thing to do. Looks as though it s just shutting off an error alert(?).

Any help would be appreciated. It s one of those cases where I struggle to even look it up because I don t know the right terminology to look for.

问题回答

If adding the directory doesn t work, take ownership of the directory:

  • Navigate to the directory in an admin terminal
  • takeown /F . /R

This was asked before, git submodule update failed with fatal: detected dubious ownership in repository at





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签