why config folder is not pushed?

前端 未结 3 1583
悲&欢浪女
悲&欢浪女 2021-01-28 04:23

Although I am sure that I\'ve added& committed ALL files and folders into my local git repo before push

I don\'t know why the remote repo is missing the config folde

相关标签:
3条回答
  • 2021-01-28 04:49

    1 empty directories

    git will not check-in an empty directory, so if your "config" dir is empty, it will not be included into your commit. "fix" that by adding a dummy-file

    touch config/nada
    git add config/nada
    git commit config/nada -m "dummy file to force inclusion of config/"
    git push heroku master
    

    2 gitignore

    probably the files in your config/ directory are in some global or system-wide .gitignore file

    EDIT1:

    there are a number of ways how you can specify files excluded by git. you might want to check all of them to see whether you are ignoring your config-directory:

    • command-line args (probably not your problem)

    • .gitignore file in the git repository directories

    • $GIT_DIR/info/exclude

    • a file specified by the core.excludes property (either system wide or global)

      git config core.excludes

      git config --global core.excludes

      git config --system core.excludes

    check all the possibilities, eventually posting them here (or at some pastebin)

    in any case, you should be able to override excludes by explicitely adding a file:

    git add config/foo.conf
    git commit config/foo.conf -m "manually added foo.conf"
    git push heroku master
    

    EDIT2:

    3 pushing...

    i don't think that "pushing" is the problem, but rather adding the files to the repository. confirm, that the config-files are indeed under git-control. e.g. after adding/committing your files do:

    git ls-files config/
    

    and make sure that the files are there.

    EDIT3:

    additionally, it might well be that you are pushing correctly to heroku, but they are not synching your repo as expected to the deployment, so the remote-console does not show the config (either because it's excluded from the sync, because it ends up somewhere else or because it's filtered out when displaying it; or because you are actually looking at the wrong place)

    so do:

    $ git add config/foo.conf
    $ git commit config/foo.conf -m "manually added foo.conf"
    $ git push heroku master
    
    $ cd /tmp
    $ git clone <remote-url-for-heroku> testclone
    $ ls testclone/config/
    

    if this works, then something is wrong with the checkout on the heroku-site. mabe you need to do something like this:

    $ heroku run bash -a dcaclab3
    [...]
    $$ git pull
    $$ ls config/
    
    0 讨论(0)
  • 2021-01-28 04:52

    There are a limited number of places git looks for ignored files. Let's check all of them (paraphrased from man gitignore):

    1.   Patterns read from the command line for those commands that support them.
    
    2.   Patterns read from a .gitignore file in the same directory as the path, or in any parent directory, with patterns in the higher level files (up to
         the toplevel of the work tree) being overridden by those in lower level files down to the directory containing the file. These patterns match
         relative to the location of the .gitignore file. A project normally includes such .gitignore files in its repository, containing patterns for files
         generated as part of the project build.
    
    3.   Patterns read from $GIT_DIR/info/exclude.
    
    4.   Patterns read from the file specified by the configuration variable core.excludesfile.
    

    It's not 1. You're using porcelain commands that don't support CLI excludes. It could still be 2 based on your current edits. What is in ~/.gitignore, and issue find ~/RubymineProjects/dcaclab -name ".gitignore" to confirm you've got no other ones lurking. To test 3, issue cat ~/RubymineProjects/dcaclab/.git/exclude. To test 4, issue git config core.excludefile and git config --global core.excludefile and edit in the output.

    0 讨论(0)
  • 2021-01-28 04:59

    As I have contacted heroku, we discovered that removing the file .slugignore which is beside file .gitignore fixed the problem!

    So, it was a bug at heroku side, sadly that was the reason, thanks for every body who tried to help on this question.

    0 讨论(0)
提交回复
热议问题