- Azure DevOps Server 2019 Cookbook(Second Edition)
- Tarun Arora Utkarsh Shigihalli
- 513字
- 2021-06-24 14:18:38
How it works...
Validate the version of Git LFS in your environment:
> git lfs version
git-lfs/2.3.4 (GitHub; windows amd64; go 1.8.3; git d2f6752f)
Verify the changes in the .gitattribute file:
\MyWebApp> type .gitattributes
*.mp4 filter=lfs diff=lfs merge=lfs -text
Create a folder to store videos and store an MP4 video in this folder:
\MyWebApp> mkdir videos
\MyWebApp> cd videos
\MyWebApp> copy c:\tmp\HandsOnDemo-vLog.mp4 .\videos
Check the size of the video file (the video size is over 640 MB):
MyWebApp\videos> dir HandsOnDemo-vLog.mp4
02/07/2018 11:53 AM 6,472,920 HandsOnDemo-vLog.mp4
1 File(s) 6,472,920 bytes
Stage the changes and check the status:
MyWebApp> git add .
MyWebApp>git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: videos/HandsOnDemo-vLog.mp4
Commit the video to your local repository:
MyWebApp> git commit -m "Vlab for hands on demo"
[master 47b4370] Vlab for hands on demo
1 file changed, 3 insertions(+)
create mode 100644 videos/HandsOnDemo-vLog.mp4
Push the changes to the remote repository. Git LFS will kick in as it detects configuration settings for .mp4 type files:
MyWebApp> git push remote origin
Locking support detected on remote "origin". Consider enabling it with:
$ git config lfs.http://Azure DevOps Server2018/Azure DevOps Server/DefaultCollection/PartsUnlimited/_git/MyWebApp.git/info/lfs.locksverify true
Git LFS: (1 of 1 files) 6.17 MB / 6.17 MB
Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 444 bytes | 444.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Analyzing objects... (4/4) (11 ms)
remote: Storing packfile... done (42 ms)
remote: Storing index... done (68 ms)
To http://azsu-p-Azure DevOps Server2018/Azure DevOps Server/DefaultCollection/PartsUnlimited/_git/MyWebApp
9304fa1..47b4370 master -> master
To investigate the contents of the commit history, use the -p switch with the Git log command:
MyWebApp> git log -p
commit 47b4370d539f85eeb765b45a51021dbd51c33634 (HEAD -> master, origin/master, origin/HEAD)
Author: tarun arora <tarun.arora@outlook.com>
Date: Wed Feb 7 12:12:50 2018 +0000
Vlab for hands on demo
diff --git a/videos/HandsOnDemo-vLog.mp4 b/videos/HandsOnDemo-vLog.mp4
new file mode 100644
index 0000000..d67c622
--- /dev/null
+++ b/videos/HandsOnDemo-vLog.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:62388612f4e5f2abe80d50fa24a4160dd0de3dc20dee75762a7135549c164a6c
+size 6472920
The important part of the commit log details is the Git LFS URL for the HandsOnDemo-vLog.mp4 file. The GitHub URL included for the version value only defines the LFS pointer file type, and is not a link to your binary file. The URL tracks the version of Git LFS you're using, followed by a unique identifier for the file (OID). It also stores the size of the final file.