我正试图使用不可能平台部署Django应用程序,方法是按照https://www.aptible.com/documentation/enclave/tutorials/quickstart-guides/python/django.html上的说明。我现在有两个遥控器:
Kurts-MacBook-Pro:lucy-web kurtpeek$ git remote -v
aptible git@beta.aptible.com:lucy/web.git (fetch)
aptible git@beta.aptible.com:lucy/web.git (push)
origin https://github.com/startwithlucy/lucy.git (fetch)
origin https://github.com/startwithlucy/lucy.git (push)我在一个分支,也叫aptible
Kurts-MacBook-Pro:lucy-web kurtpeek$ git status
On branch aptible
nothing to commit, working tree clean我想将工作树的整个内容推送到master远程的aptible分支。在递归地将整个文件夹添加到存储库中。之后,我尝试了git add --all和git commit -a,
Kurts-MacBook-Pro:lucy-web kurtpeek$ git commit --help
Kurts-MacBook-Pro:lucy-web kurtpeek$ git add --all
Kurts-MacBook-Pro:lucy-web kurtpeek$ git commit -am "Git add --all followed by git commit -am"
[aptible 9ea97969] Git add --all followed by git commit -am
2 files changed, 9254 insertions(+)
create mode 100644 docker-compose.yml
create mode 100644 lucy-app/package-lock.json后面跟着一个git push aptible aptible:master
Kurts-MacBook-Pro:lucy-web kurtpeek$ git push aptible aptible:master但是,这给我提供了来自Aptible的以下错误消息:
remote: ERROR -- : No Dockerfile found. Aborting!但是,目录中有一个Dockerfile:
Kurts-MacBook-Pro:lucy-web kurtpeek$ ls Dockerfile
Dockerfile知道为什么这个push不像预期的那样工作吗?(我还认为该项目利用了Git子树,但我不确定这是否相关)。
发布于 2018-02-06 18:26:49
来自man git-commit
-a, --all
Tell the command to automatically stage files that have been
modified and deleted, but new files you have not told Git about are
not affected.基本上,当您运行git -am ...时,这只会提交git知道有更改的文件。但是,由于您从未提交过您的Dockerfile,所以不会包含它(因为git不知道它)。
您可以从git commit -am的输出中确认这一点:只提交了docker-compose.yml和lucy-app/package-lock.json:
[aptible 9ea97969] Git add --all followed by git commit -am
2 files changed, 9254 insertions(+)
create mode 100644 docker-compose.yml
create mode 100644 lucy-app/package-lock.json在运行git add --all之前运行git commit -am ...实际上没有任何影响:git add --all确实会分阶段运行Dockerfile,但是当您运行git commit -am ...时,Dockerfile是不分阶段的。
要解决这个问题,不要在git commit上使用git commit标志,如下所示:
$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
Dockerfile
nothing added to commit but untracked files present (use "git add" to track)
$ git add --all
$ git commit -m 'Add Dockerfile'
[master 6296160] Add Dockerfile
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 Dockerfilehttps://stackoverflow.com/questions/48648938
复制相似问题