git - git 错误:“添加远程存储库:'/data/www/examplesite' 似乎不是 git 存储库”
问题描述
几年来,我一直使用本地 git 实例(通过 SmartGit)(使用安全 FTP 连接到远程服务器)。该工作流程完成了这项工作,但我想进入现代时代并将我的更新直接推送到远程服务器。
首先,在遥控盒上:
[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)
现在在本地系统上,我使用
Smartgit 日志:
[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/
接下来我尝试让本地和远程 repos 说话:
然后在这里输入我的详细信息:
单击添加会产生以下错误:
添加远程存储库:“/data/www/buymystuffs.com”似乎不是 git 存储库无法从远程存储库读取。:请确保您具有正确的访问权限并且存储库存在。
我已确认我有权访问远程目录:
[acoder@remote www]# ll
total 0
drwxrwx---. 3 apache webdev 18 May 11 15:51 buymystuffs.com
(用户 acoder 是 webdev 组的成员)
我还尝试使用git init --bare
. 这让我克服了上面的错误。当我更新一个新的本地文档时,我没有看到提交和推送的选项。我只能提交。我试过了,然后检查了远程树,发现了这个:
[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
而不是我试图提交的 index.html 文档。
我缺少哪些步骤才能在本地工作然后将提交推送到上面设置的远程仓库?
解决方案
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.
推荐阅读
- python - 创建“Buildozer-Android”打包工作流程
- git - 我不明白 .gitignore 是如何工作的
- javascript - 小米浏览器问题
- java - 一般如何从数组中删除重复项?
- excel - 如何在 Excel VBA 的 Word 文档中使用 BuildingBlockEntry().insert 方法?
- swift - 如何从排行榜中获取用户的分数?- 斯威夫特
- amazon-web-services - 如何在具有 SSL 终止的 AWS ELB 后面的多个 EC2 实例上使用 nginx 正确配置 Laravel 应用程序?
- react-native - React Native 不会在 DOM 更改时重新渲染
- javascript - 使用javascript显示带有innerHTML的java枚举值
- python - 如何安全地删除/重置在 Python 中作为 Singleton 实例创建的 postgres 连接?