On Fri, Feb 03, 2023 at 09:15:16PM +0100, Uwe Brauer wrote: > My apologies if this is slightly off-topic. > I have convinced my students to use, this year matlab+git (using > matlab's git interface which is sufficient). > > The students will do of their work at the university with Desktops that > are shared by many users, running Windows 11, unfortunately, but have > severe safety layers. > > In order to keep things simple I opted for a service that allows > cloning/pushing/pulling via https, not ssh, because to teach the > students how to generate and then manage these keys on public Desktop is > a nightmare of sorts I wanted to avoid, and that boils down to use gitlab. > > The workflow is then > > 1. Student opens a gitlab account and fork the repositories with the > exercises. > > 2. He/she clones it to the public Desktop, works, commits, and > pushes before leaving > > The problem is however, > > 1. Student 1 is doing this successfully > > 2. Student 2 uses the same PC, and tries to clone his forked > repository > > 3. Now Matlab+git refuse and an error 403 pops up > > Most likely explanation by the MathWorks team. The https credentials are > stored in the Windows credential manager and one has to delete these > credentials. > > Right now that is not possible since the only administrator knowing the > relevant passwords will return to work on Tuesday. And even then that > seems not very practical, because of security concerns > > So the question is: is it possible to use a command line git command > (matlab offers to use !git from there matlab command shell) > > That would allow to clone/push/pull via https but storing the > credentials in a different file?
Sorry for the late reply - did not notice your mail in time. Git has the concept of credential "helpers" which can also cache the (valid) credentials. I think, GfW has the so-called Git Credentials Manager (GCM) [1] as the default credential helper since v2.29. A no-brainer way to make Git use no credential helper is to explicitly turn it off, if any: git -c credential.helper="" command [arguments] See the "gitcredentials" manual page (run `git help credentials). I have no idea how this would translate to what Matlab shell provides. Quite possibly, one can control GCM in some way, but I personally have zero experience with it. Just in case, note that GfW has a dedicated mailing list [2] though I'm not sure you could get more luck there in this particular case. [1] http://microsoft.github.io/Git-Credential-Manager-for-Windows/ [2] https://groups.google.com/g/git-for-windows/ -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/20230208144754.7maftfuxnjqggtl3%40carbon.