Skip to content

Add --remote option (default: origin)#5

Open
op-ct wants to merge 1 commit into
ianfixes:masterfrom
op-ct:add-remote-option
Open

Add --remote option (default: origin)#5
op-ct wants to merge 1 commit into
ianfixes:masterfrom
op-ct:add-remote-option

Conversation

@op-ct

@op-ct op-ct commented Sep 24, 2020

Copy link
Copy Markdown

This patch adds a --remote option for repos that use a remote other than origin

@ianfixes

Copy link
Copy Markdown
Owner

If you'd like this feature to be added, I'd be glad to do so. I like the idea but I'd want to see some unit tests added -- something that shouldn't be your problem.

Can you explain what this modification is doing? Why isn't it git remote get-url #{@remote}?

    def origin_url
      `git remote -v`.lines.grep(/^#{@remote}\b/).first.split(/\s+/)[1]
    end

@ianfixes ianfixes added the enhancement New feature or request label Sep 25, 2020
@op-ct

op-ct commented Sep 25, 2020

Copy link
Copy Markdown
Author

Thanks!

get-url isn’t available on older git versions, so the previous command fails on some OS distros like EL7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants