DEV Community

Discussion on: Basic Git Commands

Collapse
 
vikramvee profile image
Vikram Chaudhary

If git commit adds changes to the git repository then what is the use of git push

Collapse
 
harveyhalwin profile image
Heinek Halwin

Git commit adds the changes to the local git repository, when you use git push, it pushes the code from your local to the remote(GitHub, bitbucket etc)

Collapse
 
acompiler profile image
aCompiler

Nice !

Collapse
 
acompiler profile image
aCompiler

Nice Question Vikram.

If you are working in team then you need to share your code with them and you need remote repository.

As Heinek answer - git commit only for local repository and git push for remote repository.

Collapse
 
vikramvee profile image
Vikram Chaudhary

That was helpful.