Skip to content

git-lfs asks for a password for SSH push urls with an HTTPS fetch url #2433

Closed

Description

@mathstuf

I have my remote URL set to prefix:username/repo where prefix: is configured as:

[url "https://somesite.com/"]
    insteadOf = prefix:
[url "ssh://somesite.com/"]
    pushInsteadOf = prefix:
    insteadOf = prefixpriv:

When pushing with LFS data, LFS tries to communicate over the HTTPS URL, requesting a username and password. If I set it to prefixpriv:, everything works fine (GitLab mentions something about passing the credentials over from SSH to the HTTPS communication). When pushing, git-lfs should query using git remote get-url --push $remote and when pulling it should query with git remote get-url $remote. The --push option was added in git-2.7.0 if it needs a version comparison attached to it.

Activity

  1. ttaylorr commented on Jul 24, 2017

    @ttaylorr
    Contributor

    Thanks @mathstuf, this definitely seems like a bug to me.

  2. larsxschneider commented on Jul 25, 2017

    @larsxschneider
    Member

    Maybe somewhat related to #2298?

  3. mathstuf commented on Jul 25, 2017

    @mathstuf
    ContributorAuthor

    Maybe. My instead of is being used properly though (nothing would work otherwise). Maybe it's a problem with LFS only asking if it doesn't "look" like a valid URL?

  4. mathstuf commented on Jul 25, 2017

    @mathstuf
    ContributorAuthor

    Looking around, I'm not sure why git-lfs is trying to decipher the config file itself rather than just asking git what's going on, but I suspect that adding tests to ensure that git-lfs gets the same answers as git in these kinds of cases would help a lot.

  5. V1460kw commented on Jul 31, 2017

    @V1460kw

    Почему мне надо обратиться в системму

  6. bitclaw commented on Nov 12, 2017

    @bitclaw

    Same here:

    git push origin master Git LFS: (1153 of 22329 files, 9667 skipped) 854.14 MB / 5.08 GB, 610.20 MB skipped Username for 'https://bitbucket.org':

    When I enter password after a while it asks for it again.

  7. technoweenie commented on Nov 13, 2017

    @technoweenie
    Contributor

    @bitclaw remove the url/insteadof stuff from your config, and you should be good to go. It's not a great workaround, but this isn't a high priority issue for us right now. It may be a good thing for a new contributor to work on though.

  8. mathstuf commented on Nov 13, 2017

    @mathstuf
    ContributorAuthor

    Would using git remote get-url be acceptable or is git-lfs going to have to learn how to do that replacement on its own as well?

  9. technoweenie commented on Nov 13, 2017

    @technoweenie
    Contributor

    It could work, but LFS already requires at least 2 git commands to run: git version and git config. That's why I prefer PRs like #2715, as extra os/exec calls tend to sneak up on you if you're not careful.

    Course, there is something to be said to relying on Git when it can give us a simple answer, like git remote get-url. An alternative solution may be to use that command, and add assertions to tests for the number of exec calls in a Git LFS command.

    @mathstuf Thanks for the reminder of that command. I should at least use it in tests to make sure PRs like #2715 are implemented correctly.

  10. mathstuf commented on Nov 14, 2017

    @mathstuf
    ContributorAuthor

    I can see a performance argument, but asking Git what it thinks is also going to always match what Git is thinking. If another way to handle remote URL rewriting were added, it would work as expected with any given Git version rather than having to be reimplemented here. But, I'm not a maintainer here (nor do I know Go well enough to contribute much), so it's not something I can make happen either way right now.

  11. self-assigned this
    on Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions