Git-missing some files

When I’m trying to push my local repository to an empty remote repository, I am doing the following:

git add .
git status

When im running git status, I see that some files are not staged, here is a screenshot of my git bash and my local working copy:

  • How to use multiline commit messages with github?
  • how to integrate git on mplab.x
  • git: How can I find out whether there is a pull request for a branch?
  • Git with 2 developers
  • Tell git that a text file is actually binary
  • VIM range line number registers
  • Screeshot of git bash and my local working copy.

    My ignore file:


    My question is: Why some files were missed?

  • Is there anyway to view all the previous GIT reverts
  • How do you save a Git diff to a file in NetBeans?
  • How to upgrade the SVN version used by git-svn
  • Walk the history with git?
  • Git log does not show history before a certain date
  • How to undo a git push on the wrong branch
  • 3 Solutions collect form web for “Git-missing some files”

    In order to include all files under a directory, you must specify it as:


    not with a single asterisk (*).

    Since you have specified to ignore all files


    except the ones you include with a bang (!), you must specify correctly the files you want to add.


    As you can read in the specifications a single asterisk matches the files directly under the directory. Not files in the subdirectories.

    In order to un-ignore all files in the directory, you need to use two consecutive asterisks:

    Two consecutive asterisks (“**“) in patterns matched against full
    pathname may have special meaning:

    • A leading “**” followed by a slash means match in all directories. For example, “**/foo” matches file or directory “foo” anywhere, the
      same as pattern “foo“. “**/foo/bar” matches file or directory “bar
      anywhere that is directly under directory “foo“.

    • A trailing “/**” matches everything inside. For example, “abc/**” matches all files inside directory “abc“, relative to the location of
      the .gitignore file, with infinite depth.

    • A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, “a/**/b” matches “a/b“,
      a/x/b“, “a/x/y/b” and so on.

    Other consecutive asterisks are considered invalid.

    Git add does not include chucks from files that are in the index.

    Please use

    git add . --all

    to include all files and remove the deleted ones.

    Are you trying to add empty directories?
    Git will not let you unless you set content to those folders? Add an empty .gitkeep file to the folder and it will be added

    Ignored files
    Have you checked that the ignored files are not set in the global ignore file

    Are you trying to add removed/renamed files?
    git add -A (replacement for git add.; git add -u .)

    Git Baby is a git and github fan, let's start git clone.