开发者

Can someone explain git's "origin" to a new git user?

开发者 https://www.devze.com 2023-03-12 07:16 出处:网络
Can someone explain in simple terms what git\'s origin is and why it\'s called \"origin\"? As I understand it开发者_运维百科, it\'s a remote repository alias. So why not call it, \"github\" or \"drop

Can someone explain in simple terms what git's origin is and why it's called "origin"?

As I understand it开发者_运维百科, it's a remote repository alias. So why not call it, "github" or "dropbox" or whatever place you're pushing to or pulling from? It seems to make more sense to me that way.

ie: $ git push github master

Is there any detriment to using a more descriptive alias name? Or am I not understanding origin in general?

Thanks!


You could certainly arrange for a remote repository with any name you like, but GIT automatically adds an origin whenever you clone a repository. It's customary to leave the 'official' repository under the alias 'origin' just for consistency.


There is no detriment. Feel free to rename it. It makes a lot of sense when you have more than one.

0

精彩评论

暂无评论...
验证码 换一张
取 消