Code Monkey home page Code Monkey logo

Comments (4)

williammartin avatar williammartin commented on June 15, 2024

Hey, thanks for the bug report.

If you provide the full URL including protocol then that will override your configured git_protocol. I've created a PR here that documents this behaviour: #9030, could you have a look and tell me if it makes sense?

from cli.

alexjurkiewicz avatar alexjurkiewicz commented on June 15, 2024

Thanks William. IMO, the URL form https://github.com/xxx/yyy should respect git_protocol. If you want to explicitly use https protocol, it's possible to use the "real" HTTPS URL, https://github.com/xxx/yyy.git.

My use case is that I'd like to easily copy and paste URLs from my web browser into my terminal, and have git_protocol respected.

from cli.

williammartin avatar williammartin commented on June 15, 2024

I hear you. That might be a reasonable approach but unfortunately this has been the behaviour since the command was first introduced and changing it would be backwards incompatible.

The best thing I can suggest is that you use a gh alias like so:

gh alias set --shell repo-clone 'gh repo clone ${1#https://github.com/}'

This performs a shell parameter expansion to remove https://github.com. Then you can call:

gh repo-clone https://github.com/xxx/yyy

and it will functionally act as:

gh repo clone xxx/yyy

from cli.

williammartin avatar williammartin commented on June 15, 2024

I've updated the title and labels to better reflect your request and updated the docs in #9030 to make it clear what the current behaviour is.

from cli.

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.