Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support for "-p" to "hub push" #302

Closed
blueyed opened this Issue Mar 21, 2013 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

blueyed commented Mar 21, 2013

It would be useful to have support for -p with git push, too.

This would use "git@github.com:user/oh-my-zsh.git" instead of "git://github.com/user/oh-my-zsh.git".

I do not know how to achieve this best, but it might work by using the "git@"-URL directly?!

Member

mislav commented Mar 21, 2013

Protip: you can set

git remote set-url --push origin git@github.com:user/oh-my-zsh.git

That way you can pull from the old (public) URL, but push to a private (SSH) URL.

Contributor

blueyed commented Mar 22, 2013

Thanks, that works as a "workaround", and survives git submodule sync.

I have used git remote set-url -p --push origin though.. :)

Member

mislav commented Jul 16, 2013

Gonna close this since the feature is available in git

@mislav mislav closed this Jul 16, 2013

You can add this to ~/.gitconfig:

[url "ssh://git@github.com/"]
    pushInsteadOf = git://github.com/
Contributor

blueyed commented Aug 4, 2014

Thanks, @nyuszika7h

To make it complete, I have also added the https scheme to it:

[url "ssh://git@github.com/"]
  pushInsteadOf = git://github.com/
  pushInsteadOf = https://github.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment