Explore Courses Blog Tutorials Interview Questions
+1 vote
1 view
in DevOps and Agile by (19.4k points)
edited by

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?

1 Answer

+1 vote
by (62.9k points)

Git Commit:

The git commit command captures a snap of the project's presently staged changes. Committed snapshots are often thought of as “safe” versions of a project—Git can ne'er change them unless you explicitly ask it to. Prior to the execution of git commit, The git add command is employed to promote or 'stage' changes to the project which will be stored in a commit.


Git Push:

The git push command is employed to upload local repository content to a remote repository.

Pushing is how you transfer commits from your native repository to a remote repo.

It's the counterpart to git fetch, however, whereas fetching imports commits to native branches, pushing exports commits to remote branches.

Remote branches are designed using the git remote command.

Pushing has the potential to write changes, caution ought to be taken when pushing.

Browse Categories