Skip to content

Asks for "Username for '://':" #431

Closed

Description

@demonyangyue

Hi there ,

I got the same issue as #322 but has a different root cause: another remote name is used instead of the default "origin".

Firstly I run git clone <my_repo_url> and everything went well.

And then I reproduced the issue:

$ mkdir my_repo
$ cd my_repo
$ git init
$ git lfs init
$ git remote add github <repo_url>
$ git pull github master

Which causes the error:

asks for "Username for '://':" and "Password for '://':"

The normal output of git lfs env should be;

Endpoint=...

But when configured with another remote name, the output is:

Endpoint (github)=...

Hope I make things clearly, thanks!

Activity

  1. aorjoa commented on Jun 23, 2015

    @aorjoa
    Contributor

    Do you config [lfs] in ~/.gitconfig ?

  2. technoweenie commented on Jun 23, 2015

    @technoweenie
    Contributor

    What's the repo url that you used? You'll have the best luck using the URL in the form of https://github.com/{user}/{repo}.

  3. demonyangyue commented on Jun 24, 2015

    @demonyangyue
    Author

    @aorjoa , yes I have configured [lfs] in ~/.gitconfig and git clone with origin as remote name works well.
    @technoweenie , I am using Github Enterprise instead of github.com. The git serve is hosted behind company's firewall. I enabled LFS for our organization.
    The url is something like http://github-<company_name>.com/<org_name>/<project_name>.git.

  4. technoweenie commented on Jun 24, 2015

    @technoweenie
    Contributor

    Ahh I see, you don't have an origin remote. Simply clone your repo from the repo url, instead of setting up a github remote. Looks like there's a bug here if you don't have an origin remote.

  5. demonyangyue commented on Jun 24, 2015

    @demonyangyue
    Author

    Yes you got it! Simply clone will set origin as remote name by default, but in our scenario, we need to use a script to download multiple repositories from different git servers in a batch, so we need to use different remote names to represent those git server addresses, then this issue occurs~

  6. michael-k commented on Jun 24, 2015

    @michael-k
    Contributor

    In this particular case, we could find out about the remote via the environment: GIT_REFLOG_ACTION=pull github master. git smudge <filename> doesn't provide us with enough information, i.e., the remote.

    But the problem itself goes deeper. The problem is not the fetch part (of the pull), it's the merge part (leading to a checkout). When checking out a specific revision, we'll never know which remote can provide us the file. We might need to check one remote after the other.

    git-annex is way better suited for this.

  7. technoweenie commented on Jun 24, 2015

    @technoweenie
    Contributor

    FWIW We have an issue open to discuss the technical details in #436.

  8. michael-k commented on Jun 24, 2015

    @michael-k
    Contributor

    @demonyangyue: Workaround suggestion:

    $ mkdir my_repo
    $ cd my_repo
    $ git init
    $ git lfs init
    $ git remote add origin <repo_url>
    $ git pull origin master
    $ git remote rename origin github
    
  9. technoweenie commented on Aug 12, 2016

    @technoweenie
    Contributor

    Closing this. You can now have more control over what remotes LFS uses by turning off the smudge capability. It just means you'll have to run git lfs pull manually, instead of relying on git's smudge filter.

    # updates global config
    $ git lfs install --skip-smudge
    
    $ git pull github master
    $ git lfs pull github
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions