Git push vs git push origin

0 votes
What's the difference between git push and git push origin?
Dec 13, 2018 in Git & GitHub by Hannah
• 14,090 points

3 answers to this question.

0 votes

hey @Hannah, 

Basically git push implicitly pushes to your work to a remote repository, with the assumption that it already exists. By default this remote repository is the origin.

In case of git push origin, it explicitly specifies to be pushed into a repository called origin.

Git push origin is usually used only where there are multiple remote repository and you want to specify which remote repository should be used for the push.

answered Dec 16, 2018 by anonymous
0 votes

Git push is mostly used to publish uploaded local changes to a central repository. After a local repo has been modified a push is executed to share the modifications. 


git checkout master
git fetch origin master
git rebase -i origin/master
# Squash commits, fix up commit messages etc.
git push origin master
answered Apr 23 by Barbara
0 votes

In simple words git push command updates the remote repository with local commits. The origin represents a remote name where the user wants to push the changes.

git push command push commits made on a local branch to a remote repository.

The git push command basically takes two arguments:

  • A remote name, for example, origin
  • A branch name, for example, master


answered Apr 23 by Hiran

Related Questions In Git & GitHub

0 votes
1 answer

Git origin not found

For this to work, you need to ...READ MORE

answered Apr 25, 2018 in Git & GitHub by DragonLord999
• 8,380 points
0 votes
1 answer

Git pull vs Git Fetch

The objective of both these commands is ...READ MORE

answered Apr 26, 2018 in Git & GitHub by DragonLord999
• 8,380 points
0 votes
1 answer

gerrit-cherry-pick:fatal: 'origin' does not appear to be a git repository

The user account making that command does ...READ MORE

answered Aug 13, 2018 in Git & GitHub by Kalgi
• 39,170 points
+1 vote
1 answer

Git: Remove committed file after push

check out the previous (unchanged) state of ...READ MORE

answered Aug 14, 2018 in Git & GitHub by Kalgi
• 39,170 points
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
0 votes
1 answer
0 votes
2 answers

What is git rebasing?

In Git, there are two main ways ...READ MORE

answered Aug 2 in Git & GitHub by Sirajul
• 16,640 points