-2

I don't know why, but I can't commit and push this new file I added.

$ git st
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   new file:   css/clearfix.css
#


$ git push origin master
Everything up-to-date

$ git pull
Already up-to-date.
chovy
  • 72,281
  • 52
  • 227
  • 295
  • 3
    You don't commit in your example - you just `push` and `pull` (neither of them is a `commit`) – zerkms Dec 23 '13 at 03:37
  • huh? it says a new file has been added. maybe i'm not using the right terminology. How do I push the new file to the git repo? – chovy Dec 23 '13 at 03:38
  • 5
    It's added to the stage, not committed yet. Commit is performed with `git commit`. "Changes **to be** committed" – zerkms Dec 23 '13 at 03:38

3 Answers3

1

What you see on your screen is a staged file.

Basically it means that git is aware of your changes but they haven't been persisted yet, which should be done using

git commit -m "Commit Message"

After that you're supposed to perform git push if you wish.

zerkms
  • 249,484
  • 69
  • 436
  • 539
1

You have add the changes to staging area only. You didn't commit it yet. Use git commit -m "Your Commit Message" to commit the changes. For further details, refer here

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
0

First you need to add your new file to git repository:

git add css/clearfix.css

Then you need to commit file to your local repository:

git commit css/clearfix.css

You are now ready to push your changes.

Pekka
  • 2,175
  • 15
  • 20