Skip to content

After updating to 2.0.0 cannot push to remote repo anymore #1998

Closed

Description

@JanGorman

Hello,

just update to 2.0.0 through homebrew. After running git lfs install to finish the installation, my prompt shows me

Git LFS initialized.
line 3: keyword expected; got api.heroku.com

And when I want to push to something, I see the same reference to heroku again:

line 3: keyword expected; got api.heroku.com
error: failed to push some refs to '[email protected]:{redacted}'

Obviously this heroku reference is something on my system but I haven't found it yet and never had this issue prior to updating.

Activity

  1. technoweenie commented on Mar 3, 2017

    @technoweenie
    Contributor

    Can you share the contents of git lfs env and git config --list? That should give me enough information to replicate the issue.

  2. JanGorman commented on Mar 3, 2017

    @JanGorman
    Author

    Yes of course:

    git lfs env yields

    git-lfs/2.0.0 (GitHub; darwin amd64; go 1.8)
    git version 2.10.0
    
    line 3: keyword expected; got api.heroku.com
    

    and git config --list:

    credential.helper=osxkeychain
    filter.lfs.clean=git-lfs clean -- %f
    filter.lfs.smudge=git-lfs smudge -- %f
    filter.lfs.required=true
    filter.lfs.process=git-lfs filter-process
    user.name=Jan Gorman
    [email protected]
    user.signingkey=CD2F8B26
    credential.helper=/opt/boxen/bin/boxen-git-credential
    core.excludesfile=/opt/boxen/config/git/gitignore
    core.pager=most +s +'/---'
    core.editor=vim
    core.quotepath=false
    hub.protocol=https
    rerere.enabled=1
    push.default=current
    color.ui=auto
    color.branch.current=yellow reverse
    color.branch.local=yellow
    color.branch.remote=green
    color.diff.meta=yellow bold
    color.diff.frag=magenta bold
    color.diff.old=red bold
    color.diff.new=green bold
    color.status.added=yellow
    color.status.changed=green
    color.status.untracked=cyan
    alias.st=status -sb
    alias.ci=commit
    alias.br=branch
    alias.co=checkout
    alias.df=diff
    alias.lg=log -p
    alias.cp=cherry-pick
    alias.pu=!git fetch origin -v; git fetch upstream -v; git merge upstream/master
    alias.up=!git remote update -p; git merge --ff-only @{u}
    alias.hist=log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
    alias.gpo=git push origin
    alias.l=!source ~/.githelpers && pretty_git_log
    difftool.Kaleidoscope.cmd=ksdiff --partial-changeset --relative-path "$MERGED" -- "$LOCAL" "$REMOTE"
    mergetool.Kaleidoscope.cmd=ksdiff --merge --output "$MERGED" --base "$BASE" -- "$LOCAL" --snapshot "$REMOTE" --snapshot
    mergetool.Kaleidoscope.trustexitcode=true
    diff.tool=Kaleidoscope
    diff.compactionheuristic=true
    difftool.prompt=false
    mergetool.prompt=false
    merge.tool=Kaleidoscope
    merge.conflictstyle=diff3
    log.date=local
    filter.lfs.required=true
    filter.lfs.clean=git-lfs clean -- %f
    filter.lfs.smudge=git-lfs smudge -- %f
    filter.lfs.process=git-lfs filter-process
    difftool.sourcetree.cmd=/usr/local/bin/ksdiff -w "$LOCAL" "$REMOTE"
    difftool.sourcetree.path=
    mergetool.sourcetree.cmd=
    mergetool.sourcetree.trustexitcode=true
    
  3. JanGorman commented on Mar 3, 2017

    @JanGorman
    Author

    Note that after downgrading to git-lfs 1.5.6 git lsf env prints out

    git-lfs/1.5.6 (GitHub; darwin amd64; go 1.7.5; git bbd328b1)
    git version 2.10.0
    
    LocalWorkingDir=
    LocalGitDir=
    LocalGitStorageDir=
    LocalMediaDir=
    LocalReferenceDir=
    TempDir=/var/folders/qh/82ndnzw145sfrc2lzx09ylnw0000gp/T/git-lfs
    ConcurrentTransfers=3
    TusTransfers=false
    BasicTransfersOnly=false
    BatchTransfer=true
    SkipDownloadErrors=false
    FetchRecentAlways=false
    FetchRecentRefsDays=7
    FetchRecentCommitsDays=0
    FetchRecentRefsIncludeRemotes=true
    PruneOffsetDays=3
    PruneVerifyRemoteAlways=false
    PruneRemoteName=origin
    AccessDownload=none
    AccessUpload=none
    DownloadTransfers=basic
    UploadTransfers=basic
    git config filter.lfs.process = "git-lfs filter-process"
    git config filter.lfs.smudge = "git-lfs smudge -- %f"
    git config filter.lfs.clean = "git-lfs clean -- %f"
    
  4. technoweenie commented on Mar 3, 2017

    @technoweenie
    Contributor

    I don't see any remotes. What does git remote -v show?

  5. JanGorman commented on Mar 4, 2017

    @JanGorman
    Author

    that gives me

    origin	[email protected]:dailymotion/dailymotion-ios-v4.git (fetch)
    origin	[email protected]:dailymotion/dailymotion-ios-v4.git (push)
    

    and ran git lsf env in the working dir again, which gives

    git-lfs/1.5.6 (GitHub; darwin amd64; go 1.7.5; git bbd328b1)
    git version 2.10.0
    
    Endpoint=https://github.com/dailymotion/dailymotion-ios-v4.git/info/lfs (auth=none)
      [email protected]:dailymotion/dailymotion-ios-v4.git
    LocalWorkingDir=/Users/j.gorman/my/work/dailymotion/develop
    LocalGitDir=/Users/j.gorman/my/work/dailymotion/develop/.git
    LocalGitStorageDir=/Users/j.gorman/my/work/dailymotion/develop/.git
    LocalMediaDir=/Users/j.gorman/my/work/dailymotion/develop/.git/lfs/objects
    LocalReferenceDir=
    TempDir=/Users/j.gorman/my/work/dailymotion/develop/.git/lfs/tmp
    ConcurrentTransfers=3
    TusTransfers=false
    BasicTransfersOnly=false
    BatchTransfer=true
    SkipDownloadErrors=false
    FetchRecentAlways=false
    FetchRecentRefsDays=7
    FetchRecentCommitsDays=0
    FetchRecentRefsIncludeRemotes=true
    PruneOffsetDays=3
    PruneVerifyRemoteAlways=false
    PruneRemoteName=origin
    AccessDownload=none
    AccessUpload=none
    DownloadTransfers=basic
    UploadTransfers=basic
    git config filter.lfs.process = "git-lfs filter-process"
    git config filter.lfs.smudge = "git-lfs smudge -- %f"
    git config filter.lfs.clean = "git-lfs clean -- %f"
    

    and additional output from git config --list in the same dir:

    core.repositoryformatversion=0
    core.filemode=true
    core.bare=false
    core.logallrefupdates=true
    core.ignorecase=true
    core.precomposeunicode=true
    [email protected]:dailymotion/dailymotion-ios-v4.git
    remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
    branch.develop.remote=origin
    branch.develop.merge=refs/heads/develop
    branch.master.remote=origin
    branch.master.merge=refs/heads/master
    
  6. technoweenie commented on Mar 5, 2017

    @technoweenie
    Contributor

    I don't see anything in there that would cause problems. I've confirmed LFS 2.0 works with an SSH remote in the same format:

    $ git remote -v
    origin	[email protected]:github/git-lfs-test.git (fetch)
    origin	[email protected]:github/git-lfs-test.git (push)
    
    $ git lfs env
    git-lfs/2.0.0 (GitHub; darwin amd64; go 1.8; git 540e90b5)
    git version 2.11.0
    
    Endpoint=https://github.com/github/git-lfs-test.git/info/lfs (auth=none)
      [email protected]:github/git-lfs-test.git

    What does which git point to? Is it some wrapper by chance? This output on all those error lines seems very suspicious: line 3: keyword expected; got api.heroku.com. What does GIT_TRACE=1 git lfs env show?

  7. javabrett commented on Mar 5, 2017

    @javabrett
    Contributor

    go-netrc is having trouble understanding your ~/.netrc file, perhaps post-heroku login. Can you describe its contents, redacted as necessary?

  8. JanGorman commented on Mar 5, 2017

    @JanGorman
    Author

    wow, some cruft in .netrc:

    machine dev.nickel-berlin.com login {user} password {password}
    machine nickel-berlin.com login {user} password {password}
    machine [email protected] login {user} password {password} api.heroku.com
      login {user}
      password {password}
    machine trunk.cocoapods.org
      login {user}
      password {password}
    machine api.heroku.com
      login {user}
      password {password}
    machine code.heroku.com
      login {user}
      password {password}
    

    and yes, line 3 is a mess. Let me just clean up that file and update update git-lfs again.

    That was it. Thanks @technoweenie and @javabrett for all your help.

  9. technoweenie commented on Mar 6, 2017

    @technoweenie
    Contributor

    Nice catch @javabrett.

    @JanGorman now what is up with that netrc file? What were the values separated by in line 3? Spaces, tabs, etc? Was it working properly, or just being ignored? I'm asking so I can look into updating the netrc package.

  10. JanGorman commented on Mar 6, 2017

    @JanGorman
    Author

    @technoweenie Separated by spaces. Line 3 was one of those crufty ones, haven't used that in like 50 years and so I can't say if it would actually properly have understood that machine.
    The second reference to api.heroku was working fine as are others in the file

  11. stahta01 commented on Apr 8, 2017

    @stahta01

    Thank you for this post.

    I had a similar issue on windows 10.

    I had two multi-line machine entries in file "_netrc" once I deleted the second one and reformatted did a
    git lfs install --force

    The problem went away.

    My file looked like this when it failed to work.
    machine api.heroku.com
    login {user}
    password
    machine code.heroku.com
    login {user}
    password

    Changed to a single line to force install like this
    machine api.heroku.com login {user} password

    After I got it installed added the second line. I was using different server names; but easier to copy the above person info. I do NOT keep a password in my netrc file.

    machine api.heroku.com login {user} password
    machine code.heroku.com login {user} password

    Tim S.

  12. stahta01 commented on Apr 8, 2017

    @stahta01

    Found the cause of this issue for me; my "_netrc" had CRLF instead of LF.
    After reformatting file the error changed; once I changed to only a single with just one machine and added a password git-lfs worked great.

    Tim S.

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