Я новичок в Git функции блокировки LFS, и у меня есть вопрос о том, как она работает с Azure DevOps. Это просто добавляет флаги только для чтения к локальной ветви? Или на сервере есть какие-то маги c, которые не позволяют изменять заблокированные файлы в удаленной ветви?
Например, я могу изменить заблокированный файл локально, и эти изменения * * * удаленная ветвь, без Azure DevOps, блокирующих "pu sh". Я ожидаю, что что-то подтвердит, что заблокированный файл не передается в удаленную ветку. Образец:
# Verify lock
C:\repo> git lfs lock .\test.png
Lock failed: There is an existing lock on this path.
# Simulate an app that changes the read-only flag, and makes changes to .\test.png
C:\repo> attrib -r .\test.png
# I opened .\test.png in MSPaint and made changes to it.
# Stage and commit changed file
C:\repo> git add .
C:\repo> git commit -m "testing changing locked file"
[master 57031ee] testing changing locked file
1 file changed, 2 insertions(+), 2 deletions(-)
# Push commit. I'd expect this fail, since file is locked by another user, but it doesn't fail.
C:\repo> git push
Consider unlocking your own locked files: (`git lfs unlock <path>`)
* test.png
Uploading LFS objects: 100% (1/1), 11 KB | 0 B/s, done.
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 374 bytes | 374.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (3/3) (267 ms)
remote: Checking for credentials and other secrets... (1/1) done (4 ms)
remote: Checking path lengths for refs and files... done (5 ms)
remote: Storing packfile... done (161 ms)
remote: Storing index... done (102 ms)
To https://<myteam.visualstudio.com/DefaultCollection/<myproject>/_git/<myrepo>
5b2a9d6..57031ee master -> master