0

I am trying to add some files to the staging area. But git isn't responding. What am I doing wrong?

This is what I get when I am querying for the current status

(web) roy@desktopL:~/Workspace/kpr-admin-db$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    .~lock.callLog.csv#
        modified:   db.sqlite3
        modified:   dbaccess/models.py
        modified:   dbaccess/models.pyc
        modified:   volunteers.csv

    Untracked files:
      (use "git add <file>..." to include in what will be committed)

        dbController.py

    no changes added to commit (use "git add" and/or "git commit -a")

When I'm trying to add

(web) roy@desktopL:~/Workspace/kpr-admin-db$ git add *
The following paths are ignored by one of your .gitignore files:
dbController.pyc
Use -f if you really want to add them.
fatal: no files added

Any help is appreciated. Thanks.

Roy
  • 59
  • 6

3 Answers3

2

First of all to add all files you have to use:

# add new, removed and updated files
# -A is alias for `git add . && git add -u`
git add -A .

Note

With Git 2.0, git add -A is default.

Copied from the above release notes:

git add <path> is the same as git add -A <path> now, so that git add dir/ will notice paths you removed from the directory and record the removal. In older versions of Git, git add <path> used to ignore removals. You can say git add --ignore-removal <path> to add only added or modified paths in , if you really want to.


In your case you have the file in your .gitignore file so you have to remove it from the file.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
1

Use the followings instead

git add .   

or

git add --all  

refert this answer

Community
  • 1
  • 1
George Chen
  • 6,592
  • 5
  • 21
  • 23
1

If you want to add recently created, deleted and updated files, use git add -A

Note : git add -A do not add files which are mentioned in .gitignore. You have to remove it from there.

Shravan40
  • 8,922
  • 6
  • 28
  • 48