Here are the git commands which I have typed
$ git add -u -n
add 'proj1/Foo.scala'
$ git add .
$ git add .
$ git commit -m "message"
On branch feature/branch
Your branch is up-to-date with 'origin/feature/branch'.
Changes not staged for commit:
modified: ../proj1/Foo.scala
So why did I get the Changes not staged for commit
? as you can see that I did git add .
twice
Now if I got ahead and do
git add ../proj1/Foo.scala
and then do commit it works. Why should I do each file specifically rather than just do git add .
git add *
instead ... Only if you KNOW you want to add ALL the added/changed files in the current working directory .. But usually you know what you want to add to your commit. And -- You could shorten by committing and adding at the same time usinggit commit -a -m "message"
which does the same thing as agit add *
– Hittelgit add .
will only add files in the current directory (aka.
). From the path in your copy/pasted commands, it looks like proj1 is up a directory? – Pehproj1/Foo.scala
, one directory below the current. Why then does the output later show the location as../proj1/Foo.scala
? – Asphaltite