Giter Site home page Giter Site logo

Comments (12)

coderanger avatar coderanger commented on August 16, 2024

What might be nicer is detecting if the username matches your own and making -p the default then.

from hub.

defunkt avatar defunkt commented on August 16, 2024

Is there any reason you do not want "-p" to be the default, with e.g. hub clone?

Are you mostly cloning your own projects? I find myself mostly cloning open source projects.

What if you could set an environment variable saying you want -p by default?

Also, "-p" is not documented anywhere, except for the examples and in the source itself, as far as I can see.

What documentation are you using to learn hub? The manual documents -p (man hub or http://defunkt.github.com/hub/hub.1.html).

Just wondering where it needs to be added.

from hub.

defunkt avatar defunkt commented on August 16, 2024

coderanger: That's a nice idea but it won't work for Organizations, e.g. git clone github/secret-project for me.

from hub.

coderanger avatar coderanger commented on August 16, 2024

@defunkt Sure, but the majority of users probably just use it with personal repos. You can always do it manually for orgs (or someone elses' repo you are a commiter on).

from hub.

defunkt avatar defunkt commented on August 16, 2024

@coderanger Okay I 180'd, I like it.

from hub.

mislav avatar mislav commented on August 16, 2024

How about keeping the public URL for pulling (current behavior), but also configuring a "pushurl" for pushing to contain the SSH URL.

Best of both worlds: you can still clone opensource projects which you don't own, but if you happen to have write access, you can push just as well.

Here's what I have for hub:

[remote "origin"]
    url = git://github.com/defunkt/hub.git
    pushurl = [email protected]:defunkt/hub.git

If -p was used, the main URL would be SSH (current behavior).

I agree that we could make -p implicit when cloning repos under your own name.

from hub.

sometimesfood avatar sometimesfood commented on August 16, 2024

I've been meaning to implement this for some time now, glad to see that I'm not the only one who would like hub to do this.

Here's a pull request:
#65

If you would like me to make any changes, just let me know.

from hub.

mislav avatar mislav commented on August 16, 2024

Closing this because 1) I've just made a change to always clone own repos via SSH, and 2) there's now a configuration setting which turns on HTTPS globally so you can transition away from git:/ssh: protocols. Of course, with the former there is an issue with credential caching, but that's outside the scope of hub.

I don't want to turn on SSH by default since that would sabotage easy cloning of opensource repos.

from hub.

Natim avatar Natim commented on August 16, 2024

I had to configure my bash like that but it is ugly:

function hub() {
  case $* in
    clone* ) shift 1; command hub clone -p $@ ;;
    * ) command hub $@ ;;
  esac
}

At least an env variable to be able to set -p as the default will be good. I don't understand why you couldn't clone opensource projects with -p option btw.

from hub.

udiboy1209 avatar udiboy1209 commented on August 16, 2024

I'm reviving a long settled matter I guess, but I would appreciate some config option to make ssh accesses / remote urls default. Maybe make git config --global hub.protocol ssh work. I am behind a firewall which blocks git:// url port and so I have currently settled to using https urls. But I would prefer ssh as it provides better speed.

from hub.

mislav avatar mislav commented on August 16, 2024

Maybe make git config --global hub.protocol ssh work.

It works since 352ade6. Grab one of the 2.3.0-pre builds from the Releases section!

from hub.

udiboy1209 avatar udiboy1209 commented on August 16, 2024

Thats great! Thanks @mislav!

from hub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.