Reputation: 69
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.
Upvotes: 0
Views: 938
Reputation: 141946
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 .
With Git 2.0, git add -A
is default.
Copied from the above release notes:
git add <path>
is the same asgit add -A <path>
now, so thatgit 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 saygit 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.
Upvotes: 2
Reputation: 9888
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.
Upvotes: 1
Reputation: 6939
Use the followings instead
git add .
or
git add --all
refert this answer
Upvotes: 1