2

I have created a project in flask (python), and within my app is config.py file which I have in .gitignore.

This .gitignore found good that config.py isn´t upload to git (github.org), but when I have to push to dokku (git push dokku master), I must include config.py but config.py is in .gitignore so it isn´t push to dokku.

So how can I push files which are in .gitignore to dokku ?

4

1 回答 1

0

如果文件未被 跟踪git,则无法使用 git 推送它。您可能会成功使用诸如 etc 之类的外部服务rsync,但不会使用git.

将您的config.py放入gitignore基本上可以忽略 git。

克服这个问题的最简单方法是将你签config.py入 git,即

  1. 将其从您的.gitignore
  2. 使用将其添加到您的存储库

    git add config.py && git commit -m "adding config.py"
    git push origin master
    

一般来说,如果你在构建过程中需要一些文件,并且它不能自动生成,你应该将该文件签入到 git 中。

于 2015-02-03T15:53:00.860 回答