I just started using git. I'm used to use SVN version control before.
Why do I have to do git push origin master
every time I commit something to see the changes on GitHub?
Shouldn't git commit -m "blah blah"
be enough?
I just started using git. I'm used to use SVN version control before.
Why do I have to do git push origin master
every time I commit something to see the changes on GitHub?
Shouldn't git commit -m "blah blah"
be enough?
That is the beauty of Git, in many opinions. A commit saves your changes to your local repository, and your push makes that commit (as well as any other commits you've made since the last time you pushed) available to others viewing the repository. This allows you to make multiple offline incremental commits before pushing a feature to the remote server for others to see.
Although a bit heavily detailed, the Git documentation for working with remotes can be very helpful.
Hope this helps!
Exactly what William said
When you 'git commit ......' That is on your local repo on your machine. GitHub does not have reference to your local repository. This is why you can also make numerous branches to test things out without flooding "remote" (the server reference)
When you "git push origin master" you are telling the server to take your additional commits it is not aware of.