Comments (12)
What might be nicer is detecting if the username matches your own and making -p the default then.
from hub.
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.
coderanger: That's a nice idea but it won't work for Organizations, e.g. git clone github/secret-project
for me.
from hub.
@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.
@coderanger Okay I 180'd, I like it.
from hub.
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.
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.
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.
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.
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.
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.
Thats great! Thanks @mislav!
from hub.
Related Issues (20)
- Executing git push after hub pr checkout doesn't work #2929 HOT 1
- Msfs_mouse_yoke-0.3c HOT 2
- Error creating repository: Forbidden (HTTP 403) HOT 2
- This dependency update will be handled internally by our engineering team.
- Error creating pull request from issue HOT 2
- update Go version
- Adebayo
- At least 1 approving review is required Bug HOT 2
- #690
- Please bump the golang.org/x/sys dependency
- Let `hub fork` copy only the main branch
- Error on fetching origin
- value from the inputs are not passing to the called workflow when using Reusable workflow scenario
- Deleting a tag not possible?
- Github New Update Bug in Mobile HOT 1
- This is no longer planned due to a change in our strategic priorities and the allocation of our resources towards higher-priority initiatives.
- My
- `git pull --rebase` for `hub sync`
- `hub` is not available on GitHub actions HOT 2
- Question: Is it possible to add the project About text when creating a new GitHub...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hub.