仅将一个文件推送到Heroku的问题

时间:2016-08-05 07:44:25

标签: git heroku nltk

以下是我的烧瓶项目结构。我在heroku上遇到nltk的问题,所以基于一些文档,我在我的项目中包含了NLTK数据文件夹,并将所有文件添加到git中并将其推送到heroku。下一次,如果我只是更改app.py文件并且只想推送app.py,那么我按照以下命令显示。但每次我进行更改并只向git添加一个文件时,提交并推送它将永远消失。

C:\Users\mysys\mywebservices>dir
 Volume in drive C is OSDisk
 Volume Serial Number is B08D-8A75

 Directory of C:\Users\mysys\mywebservices

08/04/2016  02:18 PM    <DIR>          .
08/04/2016  02:18 PM    <DIR>          ..
08/05/2016  10:40 AM                18 .gitignore
08/05/2016  12:07 PM             1,546 app.py
08/03/2016  06:52 PM               369 instructions.txt
08/03/2016  06:42 PM    <DIR>          mywebservices
08/04/2016  02:30 PM    <DIR>          nltk_data
08/03/2016  06:38 PM                21 Procfile
08/04/2016  02:33 PM               135 requirements.txt
               5 File(s)          2,089 bytes
               4 Dir(s)  12,047,900,672 bytes free

以下是使用的命令。即使是app.py中的微小更改,也会推送大量文件。我错过了什么,请告诉我。

C:\Users\mysys\mywebservices>git status
On branch master
Your branch is ahead of 'origin/master' by 19 commits.
  (use "git push" to publish your local commits)
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   app.py

no changes added to commit (use "git add" and/or "git commit -a")

C:\Users\mysys\mywebservices>git add app.py

C:\Users\mysys\mywebservices>git commit -m "testing nltk"
[master 5990375] testing nltk
 Committer: mysys <mysys@mydomain.com>
Your name and email address were configured automatically based
on your mysys and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 1 insertion(+), 1 deletion(-)

C:\Users\mysys\mywebservices>

C:\Users\mysys\mywebservices>git push heroku master
Counting objects: 23025, done.
Delta compression using up to 4 threads.
Compressing objects:  82% (18925/22974)

1 个答案:

答案 0 :(得分:0)

推进Heroku通常需要相当长的时间,因为每次你推到Heroku:

  • 您首先将所有项目代码上传到Heroku。如果您做了很多更改(在这种情况下,您的日志显示您正在推送19次提交),您可能会将大量数据推送到Heroku。
  • 接下来,Heroku扫描您的项目并运行他们的buildpack脚本。
  • 然后Heroku尝试安装所有项目依赖项(即使没有任何更改)。这可能需要一段时间,具体取决于项目的依赖项数量。
  • Heroku然后建立一个伪&#39;完全建成项目的图像。
  • 然后Heroku将这个伪图像部署到你运行的许多dynos中。
  • Heroku然后移除旧的dynos并在等待设定的超时后用新的dynos替换它们。