When I enter in console:
$ git add .
I get:
Nothing added Nothing Specified. May be you wanted to say 'git add.'?
The order should look like this:
1) start a branch: git checkout -b my_cool_branch
2) do stuff on that branch
3) add the things you've changed to your commit queue: git add .
4) commit the things you added to your queue: git commit -m "i'm adding stuff!"
(optionally)
5) switch back to master (or whatever your main branch is): git checkout master
6) push your local commits to your github: git push origin master
The error you're seeing makes me think that you've skipped step 2 - are you sure you've made changes? run git status
to see tracked/untracked changes.
if git add .
doesn't do anything there are two possibilities:
e.g. with an empty folder:
$ git add .
$ git status
# On branch master
#
# Initial commit
#
$ ls -la
drwxrwxr-x 3 andy andy 4096 Aug 26 11:34 .
drwxrwxrwt 11 andy andy 4096 Aug 26 11:34 ..
drwxrwxr-x 7 andy andy 4096 Aug 26 11:34 .git
Or, if everything is already tracked and unchanged:
$ touch foo
$ git add foo
$ git commit -m "adding foo"
[master (root-commit) d27092b] adding foo
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 foo
$ git add .
$ git status
# On branch master
nothing to commit, working directory clean
$ ls -la
drwxrwxr-x 3 andy andy 4096 Aug 26 11:34 .
drwxrwxrwt 11 andy andy 4096 Aug 26 11:34 ..
-rw-rw-r-- 1 andy andy 0 Aug 26 11:35 foo
drwxrwxr-x 7 andy andy 4096 Aug 26 11:34 .git
Note that git status did not report any changes.
If a file/folder is ignored git will, well, ignore it :)
However you can still add it explicitly:
$ echo "bar" > .gitignore
$ touch bar
$ git add bar
The following paths are ignored by one of your .gitignore files:
bar
Use -f if you really want to add them.
fatal: no files added
$ git add -f bar
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: bar
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
$
Use the git
commit