Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to get username used by git-lfs lock?

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)?

like image 246
Speedicut Avatar asked Nov 04 '25 05:11

Speedicut


1 Answers

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.

like image 171
Lavi Arzi Avatar answered Nov 07 '25 02:11

Lavi Arzi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!