tags:

views:

65

answers:

1

Does Git only use the remote name origin for a repository which was created by cloning?

eg, say I create a repository, place it on a remote, and try to clone it again into the same directory, which one would Git name origin?

+1  A: 

origin is the default name used by git clone, but you can use any other name when cloning:

--origin <name>
-o <name>

Instead of using the remote name origin to keep track of the upstream repository, use .

If you don't, any time you clone a repo, that remote repo will be referenced by the default name 'origin'.

VonC
I think I am beginning to understand git better. I think git has too many shortcuts and abbreviated ways of doing the same thing and it all gets confusing.To put it precisely, a git clone command which omits the --origin name or -o name options defaults to using 'origin' as a shortcut/name for that repo.I think the git user community's eagerness to show how easy and simple git commands can be made only makes slows down comprehension
vfclists
Are you saying you'd rather it ask you for the upstream name every time avoiding any hope of consistency, or just never allow you to change the name of that remote? There's nothing special about a remote name. I have large numbers of remotes in some of my repos. Some have two (or more) natural upstreams. git has very little magic. Declaring the word `origin` magical would only make comprehension harder.
Dustin