0

We followed the solution provided here Shallow fetch for repository to achieve git clone without git history but didnt work. still git is checking out the history.

We are using Azure DevOps pipeline to build our long running application whose repo is having much size. Its noticed that the Git history is huge and the .git folder is having 4+ GB .

So when Azure DevOps pipeline is getting executed the default pipeline task of "checkout source repo " is taking long time to get cloned the entire repo and for each build its taking too much time and the entire build process is delayed with this.

So we are looking for an solution in the pipeline where the Git checkout task didn't need to clone the entire history of the repo (without .git ) and only need to clone the specific branch for that build.

We tried with different arguments in the git checkout tasks like below, but didn't help.

- checkout: self
  fetchDepth: 1

Below is the git checkout logs. Its keep on downloading and took 2 hours to checkout the repository.

git config gc.auto 0
git config --get-all http.https://ado.mydomain.com./devops/myrepo
git config --get-all http.proxy
git -c http.extraheader="AUTHORIZATION: bearer ***" fetch  --tags --prune --progress --no-recurse-submodules --depth=1 origin xxxxxxxxxxxxxxxxxxxxxxxxxx:refs/remotes/origin/xxxxxxxxxxxxxxxxxxxxxxxxxxx
remote: Azure Repos        
remote: This repository is a fork. Learn more at https://aka.ms/whatisafork.        
remote: To add its upstream as a remote, run:        
remote: git remote add upstream https://ado.mydomain.com./devops/myrepo      
remote: 
remote: 
remote: Found 27732 objects to send. (655 ms)        
Receiving objects:   0% (1/27732)   
Receiving objects:   1% (278/27732)   
Receiving objects:   2% (555/27732)   
Receiving objects:   3% (832/27732), 131.96 KiB | 250.00 KiB/s   
Receiving objects:   3% (915/27732), 387.88 KiB | 376.00 KiB/s   
Receiving objects:   4% (1110/27732), 387.88 KiB | 376.00 KiB/s   
Receiving objects:   5% (1387/27732), 643.79 KiB | 418.00 KiB/s   
Receiving objects:   6% (1664/27732), 643.79 KiB | 418.00 KiB/s   
Receiving objects:   6% (1737/27732), 899.71 KiB | 438.00 KiB/s 
Vowneee
  • 956
  • 10
  • 33

0 Answers0