git / git-reference

Online Git Reference at http://git.github.io/git-reference/
Other
996 stars 363 forks source link

add "git config remote.origin.pushurl" info #5

Closed certik closed 10 years ago

certik commented 14 years ago

Many times, you clone a repo using

git clone git://github.com/certik/jsplot.git

and you'd like to push in using:

git push origin master

you can do that by:

git config remote.origin.pushurl git@github.com:certik/jsplot.git

it'd be cool to have this trick in the remotes section

sakekasi commented 13 years ago

is the same true of

git config remote.origin.fetchurl ?

ComputerDruid commented 13 years ago

The same is not true, according to a quick grep of the git sources. However, there is no need for such an option as both url and pushurl can be defined at the same time, and fetch will use url and push will use pushurl

ComputerDruid commented 13 years ago

Also note, the proper way to set a pushurl is with git remote set-url --push ssh://user@host/path/to/repo.git

timc13 commented 13 years ago

how is that different than git config remote.origin.pushurl ssh://user@host/path/to/repo.git ?

ComputerDruid commented 12 years ago

It is not functionally different, as set-url internally ends up just calling config. But set-url will complain if you mistype the command part "git remote set-url --push", whereas git config will silently accept mistyped options, but fail to actually set the remote's url.

Additionally, it is possible that set-url with, in the future, do some sanity checking on the value entered, whereas config will never do that.

matthewmccullough commented 12 years ago

I know it has been a long while (7 months) since the last discussion in here. However, having just taken this repo over I'd be so glad to see a contribution of a Pull Request that added the distillate from this discussion about git remote set-url and its sanity checking for updating the URL. I'd gladly merge it in and give it polish. Let me know if you are up for creating a Pull Request @tbone47.

randomecho commented 11 years ago

Anyone still on this? Would be up for giving it a crack if nobody minds.

matthewmccullough commented 11 years ago

@randomecho I know some folks are out of the holidays, but if you don't hear back from folks in a day or so, I'd say, please, please attack it. We'd be delighted!