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:

    *.*
    
    #####Directories
    !CefSharp/Internals/*
    !CefSharp/Properties/*
    
    !CefSharp.BrowserSubprocess/Properties/*
    
    !CefSharp.Core/Internals/*
    !CefSharp.Core/Win32/*
    
    !CefSharp.Example/ExtensionMethods/*
    !CefSharp.Example/Properties
    !CefSharp.Example/Proxy
    !CefSharp.Example/Resources
    
    !CefSharp.WinForms/Internals/*
    !CefSharp.WinForms/Properties/*
    
    !CefSharp.WinForms.Example/Minimal/*
    !CefSharp.WinForms.Example/Properties/*
    !CefSharp.WinForms.Example/Resources/*
    !CefSharp.WinForms.Example/Tools/*
    
    !ipch/*
    !packages/*
    !Resources/*
    !RexCao/Properties/*
    
    !SysHandle/Properties/*
    
    !TimesheetUpdater/Properties/*
    !TimesheetUpdater/Resources/*
    !TimesheetUpdater/Tools/*
    
    !TSNetChecker/Properties/*
    !TSNetChecker/Resource/*
    !TSNetChecker/Resources/*
    !TSNetChecker/Tools/*
    
    !UIThreadTest/Properties/*
    
    !Win32/*
    
    #####Files
    !CefSharp/*.cs
    !CefSharp/*.csproj
    
    !CefSharp.BrowserSubprocess/app*
    !CefSharp.BrowserSubprocess/*.csproj
    !CefSharp.BrowserSubprocess/*.cs
    
    !CefSharp.BrowserSubprocess.Core/*.cpp
    !CefSharp.BrowserSubprocess.Core/*.h
    !CefSharp.BrowserSubprocess.Core/*.vcxproj.*
    !CefSharp.BrowserSubprocess.Core/*.config
    
    !CefSharp.Core/*.cpp
    !CefSharp.Core/*.h
    !CefSharp.Core/*.vcxproj.*
    !CefSharp.Core/*.config
    
    !CefSharp.Example/*.cs
    !CefSharp.Example/*.csproj
    
    !CefSharp.WinForms/*.csproj
    !CefSharp.WinForms/*.cs
    
    !CefSharp.WinForms.Example/*.cs
    !CefSharp.WinForms.Example/app.*
    !CefSharp.WinForms.Example/*.csproj.*
    !CefSharp.WinForms.Example/*.ico
    !CefSharp.WinForms.Example/*.config
    !CefSharp.WinForms.Example/*.resx
    
    !RexCao/*.cs
    !RexCao/*.csproj
    
    !SysHandle/*.cs
    !SysHandle/*.csproj
    
    !TimesheetUpdater/*.ico
    !TimesheetUpdater/*.cs
    !TimesheetUpdater/*.resx
    !TimesheetUpdater/*.csproj
    
    !TSNetChecker/*.cs
    !TSNetChecker/*.resx
    !TSNetChecker/*.ico
    !TSNetChecker/*.csproj
    
    !UIThreadTest/*.config
    !UIThreadTest/*.cs
    !UIThreadTest/*.resx
    !UIThreadTest/*.csproj
    
    !.gitignore
    !*.ps1
    !*.yml
    !*.bat
    !*.props
    !*.snk
    !*.sdf
    !*.sln
    

    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:

    !directory/**
    

    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.

    Background

    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.