DEV Community

Discussion on: Git Explained: The Basics

Collapse
 
milu_franz profile image
Milu

This is a great question Cristian! origin stands for your remote repository. So when you use "git push origin [branch-name]", you are saying push my code to a branch called [branch-name] in this specific remote repository called "origin". Most of the time you only have one remote repository and "origin" is the default name git gives to it. You can change the default name "origin" to whatever you want using "git remote rename origin [new-remote-name]". Hope this helps!

Collapse
 
gcristiantoma profile image
gcristiantoma

Thanks for answering , very kind ! :) so it's a good practice to have just one repository, not to create one for each new project ? Sorry for the confusion :D

Thread Thread
 
milu_franz profile image
Milu

In most instances, you are going to have one remote repository per project. However, I've had a few abnormal circumstances where I've had to use two remote repositories for one project (i.e. one repository on Gitlab and one on Bitbucket for two different teams working on the same project). It is a bit confusing and unusual but I'm planning to make a blog post about it in case someone needs it in the future :)

Thread Thread
 
gcristiantoma profile image
gcristiantoma

Great explanation ! Thank you :-)