I have a repo in which I am using git-lfs for file locking only (I'm not tracking any files). The remote host is our on-prem GitLab server. When a file is locked with 'git lfs lock' the lock owner's username is, I believe, provided by the GitLab server. This could be different to my Linux username or indeed my git config username, e.g.
$ whoami
jbloggs
$ git config user.name
Joe
$ git lfs locks --path=file.txt
file.txt Joe Bloggs ID:1
For a bash script I'm writing I want to be able to marry up these three usernames and effectively treat them as one. Is there a way from the command line of getting a user's lfs lock username (without having to, for example, temporarily lock a file and run git lfs locks and grab the owner name from the output)?
The username is not a part of the git LFS client, but a part of the server's response. It's up to the LFS locks server to decide what name to give. See https://github.com/git-lfs/git-lfs/issues/3252.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With