Alex Rivera | Logout

What are the differences between "git commit" and "git push"?

Asked 2010-04-30T14:17:12.077
1012

In a Git tutorial I'm going through, git commit is used to store the changes you've made.

What is git push used for then?

Edit
Report

1 Answer

1795

Basically, git commit "records changes to the repository" while git push "updates remote refs along with associated objects". So the first one is used in connection with your local repository, while the latter one is used to interact with a remote repository.

Here is a nice picture from Oliver Steele, that explains the Git model and the commands:

Git data transport commands

Read more about git push and git pull on Pushing and pulling (the article I referred to first).

answered 2010-04-30T14:20:17.653

Your Answer