Search code examples
gitsmartgit

git error: "Add Remote Repository: '/data/www/examplesite' does not appear to be a git repository"


I've used a local instance of git (via SmartGit) for a few years (using secure FTP to the remote server). That workflow does the job but I want to move into the modern age and push my updates directly to the remote server.

First, on the remote box:

[acoder@remote www]# mkdir buymystuffs.com
[acoder@remote www]# cd buymystuffs.com/
[acoder@remote buymystuffs.com]# git status
fatal: Not a git repository (or any parent up to mount point /data/www)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[acoder@remote buymystuffs.com]# git init
Initialized empty Git repository in /data/www/buymystuffs.com/.git/
[acoder@remote buymystuffs.com]# git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)

Now on the local system I set up a new repo using

enter image description here

Smartgit Log:

[master (root-commit) bd5a85f] initial commit
/storage/web/git/buymystuffs.com> git commit --allow-empty --file=/tmp/smartgit-2242088229372859523tmp/commit-95902291203419258.tmp
/storage/web/git/buymystuffs.com> git init
Initialized empty Git repository in /storage/web/git/buymystuffs.com/.git/

Next I try to get the local and remote repos talking:

enter image description here

Then enter my details here:

enter image description here

Clicking Add produces the following error:

Add Remote Repository: '/data/www/buymystuffs.com' does not appear to be a git repository Could not read from remote repository.: Please make sure you have the correct access rights and the repository exists.

I've confirmed that I have permissions to the remote directory:

[acoder@remote www]# ll
total 0
drwxrwx---.  3 apache webdev  18 May 11 15:51 buymystuffs.com

(user acoder is a member of the webdev group)

I also tried setting up the remote tree with git init --bare. That let me get past the erros above. When I updated a new local document, I did not see an option to Commit and Push. I could only Commit. I tried that, then checked the remote tree and found this:

[acoder@remote buymystuffs.com]$ ll /data/www/buymystuffs.com
total 12
drwxrwxr-x. 2 acoder acoder   6 May 14 10:32 branches
-rw-rw-r--. 1 acoder acoder  66 May 14 10:32 config
-rw-rw-r--. 1 acoder acoder  73 May 14 10:32 description
-rw-rw-r--. 1 acoder acoder  23 May 14 10:32 HEAD
drwxrwxr-x. 2 acoder acoder 242 May 14 10:32 hooks
drwxrwxr-x. 2 acoder acoder  21 May 14 10:32 info
drwxrwxr-x. 4 acoder acoder  30 May 14 10:32 objects
drwxrwxr-x. 4 acoder acoder  31 May 14 10:32 refs

Instead of the index.html document I attempted to commit.

What step(s) am I missing to be able to work locally then push commits to the remote repo set up above?


Solution

  • After a bit of research, the answer is that I am unable to make git do what I want it to do. Both /home and the /data/www directories (and /var) are marked noexec which rules out a post-update hook to push & deploy.

    We're unable to remove noexec, so I am kind of out of luck. If you have a workable solution that lets me do this in a noexec environment please follow up.

    Thanks to SO user muecas for the helpful conversation.