warning: You ran 'git add' with neither '-A (–all)' or '–ignore-removal'

I tried to add my files to staging on another branch in git. Basically I have done the following

  1. git checkout -b <newBranch>
  2. Modified some files in that new branch
  3. git add .

But got the following warning (I have not found anything like this in SO and surprisingly on by googling. It is very surprising for me):

  • msys git and long paths
  • Replaced text with BFG, and now it shows my fork is several hundred commits ahead/behind
  • Does grit have to be on the same server as the repositories?
  • Migrating project to Git/Gerrit. Access control questions?
  • GitLab: is there a way to assign a status/comment to a branch?
  • Python script to determine if a directory is a git repository
  • warning: You ran ‘git add’ with neither ‘-A (–all)’ or
    ‘–ignore-removal’, whose behaviour will change in Git 2.0 with
    respect to paths you removed. Paths like
    ‘thePathToFileIDeleted’ that are removed from your working
    tree are ignored with this version of Git.

    • ‘git add –ignore-removal ‘, which is the current default, ignores paths you removed from your working tree.

    • ‘git add –all ‘ will let you also record the removals.

    Run ‘git status’ to check the paths you removed from your working
    tree.

    Does anyone know what does it mean and what should I do in the following situation? My git version 1.8.3.2

  • Git access to private repository using HTTPS
  • Is branch level read/write access permission available in Bonobo Git Server?
  • How do you handle sensitive data in a public git repo?
  • How does SHA generate unique codes for big files in git
  • What HTTP Protocols does GIT use when cloning and pushing?
  • git: Get absolute path of file, relative to repo
  • 2 Solutions collect form web for “warning: You ran 'git add' with neither '-A (–all)' or '–ignore-removal'”

    It is saying that you should use either git add -A or git add --ignore-removal ., because git add . will have a different behavior in the newer version of git. Since it says the current version will ignore deleted paths, my best guess is that the next version will default to including them.

    It wants you to be explicit about what whether you want to stage deleted paths in the current directory.

    If you want to add deleted paths, you should use git add -A.

    If you do not want to add deleted paths, you should use git add --ignore-removal .

    I think it is merely trying to warn you so that you will know that your command will do something unexpected (ie different from now) if you upgrade git, so you can take one of the above two options or just make a note of the coming change and move on, with the understanding that you are currently ignoring deleted paths.

    Apparently this is not really a big deal right now, because everything worked correct in my case (I was able to commit my stage, merge branches and push everything to the server with no problems).

    The problem I encountered is because I deleted some file (I used similar procedure previously for a lot of time with the no warnings). Based from my understanding git is just telling me that the current format is already deprecated and will be changed in version 2. It looks like I have to use git add -A to actually remove my file from staging.

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