Christian Wolf Christian Wolf - 1 year ago 132
Git Question

How to setup gitconfig for default remote name?

I want to set up my git (TortoiseGIT) using the global gitconfig file such that the default remote name when I clone a repository is not "origin" but some other text defines by me (e.g. "foo").

Is this possible? Which directives are the ones?


Edit: The intention of that is, that I create several smaller repositories for different, independent tasks (documentation!) and I am tired of every time modifying the name of the remote since it is available using shares to other users. So the name of the remote should be my machine's name to avoid confusing the other git versions. I know this is not best practice but that's life :(.

Answer Source

There is no global config option. You will have to use git clone --origin foo <source> to change the name of the "origin" repository when you clone it:

--origin <name>, -o <name>  
   Instead of using the remote name origin to keep track of the upstream
   repository, use <name>.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download