The clone gitlab project that uses git lfs without providing a password all the time

I decided to try git lfs on gitlab. I noticed that it does not work with ssh, so I decided to use https for it. Push works very well, but when I tried to clone my project, it asked me to enter a username and password for each file.

This is annoying. Is there any workaround?


EDIT 2018

This problem persists, where is the real solution? Is there a simple and direct recipe for this?

Links https://git-scm.com/docs/gitcredentials and git-lfs / wiki / Tutorial is something but not an objective solution.

The situation described by my git lfs env ,

 git-lfs/2.4.0 (GitHub; linux amd64; go 1.8.3) git version 2.7.4 LocalWorkingDir= LocalGitDir= LocalGitStorageDir= LocalMediaDir=lfs/objects LocalReferenceDir= TempDir=lfs/tmp ConcurrentTransfers=3 TusTransfers=false BasicTransfersOnly=false SkipDownloadErrors=false FetchRecentAlways=false FetchRecentRefsDays=7 FetchRecentCommitsDays=0 FetchRecentRefsIncludeRemotes=true PruneOffsetDays=3 PruneVerifyRemoteAlways=false PruneRemoteName=origin LfsStorageDir=lfs 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 when I do git clone https://github.com/myPrivate/project1 , the process of cloning the problem is not completed (error) and was giving usernae and password all the time ...

Problems also when trying to execute credentials (see issue # 2223 , etc.)


Report Attempt:

  • git config credential.helper does not display anything, empty message.

  • git config -f .lfsconfig lfs.url https://github.com/myPrivate/MyProj1 accepts something ... So, browser URL or .git URL?
    After it, the git add .lfsconfig says "fatal: not a git repository (or any of the parent directories) :. git" in both cases (URL with or without .git)

  • git config credential.https://github.com/myPrivate/MyProj1 myusername say "fatal: not in the git directory", but of course I need to clone first (!) ..

  • ...

+5
source share
3 answers

As mentioned in git-lfs issue 993 :

Because the LFS server and the git server can be separate endpoints, it is possible that the user has permission for the git server, but not on the LFS server.

In this case, if the credential manager is installed, the credentials will not be reset, and LFS will use them on every subsequent request, without invalidating them.

You should check your git config credential.helper output.
On Windows, this should be (with the latest releases of 2017-2018 git) "manager".
Open Windows Credential Manager and delete or correct any GitHub account.

Note: issue 2349 indicates that Git-LFS had a problem requesting credentials (in the absence of an assistant) due to the lack of pty / tty , but this was probably fixed.


Broadcast in mannequins

(combining response and comments)

  • check out git --version , if less than tham 2.16, install better here using PPA .

  • check the output of git config credential.helper if it is empty
    run the following line: git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
    ... Then check your git config credential.helper output: it should be /usr/...

  • Cloning...

    3.1. (as commented) Do it first: git ls-remote https://github.com/myPrivate/MyProj1 ... This should bring up your GitHub username and password. Repeat this command to verify that the second time, it asks for nothing about you.

    3.2. Make your usual git clone (with caution, delete the broken old one with sudo rm -r oldBrokenBadClone ) ... Give username and password once.

+2
source

You can use a Git credential account that supports Git lfs (has persistent storage and in-memory cache ).

I also noticed that Git lfs has some issues related to this that were resolved.

+1
source

If a password is not required for the actual access to files and access to it from the URL https://server.com/path/to/repo , it should work ( from git -lfs 0.5.3 ). One possibility is that your configuration has lfs.batch = false . Try git -c lfs.batch=true clone https://server.com/path/to/repo --- no helper is needed.

0
source

Source: https://habr.com/ru/post/1246301/


All Articles