On Saturday, June 17, 2017 at 11:48:19 AM UTC-6, Idan Adar wrote:
>
> Okay, so looks like what I should try in order to:
> 1. make checkouts faster
> 2. be able to git tag & push
>
> Is the following:
>
> 1. Try with:
>
> checkout(
>  extensions: [
>      [$class: 'CloneOption',
>           depth: 1,
>           shallow: true
>      ]
>  ]
> )
>
>
>
I look forward to hearing that it helped with your use case.

There are several ways to reduce the work done by git fetch or git clone, 
each with its own set of reasons it helps and reasons it hinders.  For 
example:

   - An intentionally narrow refspec (like 
   +refs/heads/master:refs/remotes/origin/master) reduces the objects copied 
   in the clone to only those in that refspec (typically the desired branch), 
   while still providing the full history of the working branch (but not the 
   history of other branches in the repository)
   - A reference repository updated on the agent (by whatever means you 
   wish) can avoid network copies of objects by allowing git fetch and git 
   clone  to point to the references instead of retrieving them.  This can be 
   a major savings with large repositories, since multiple jobs can point to a 
   single copy of the reference repository and save disc space and network 
   transfer
   - Large file support (LFS) can reduce network transfers by only 
   transferring the current copy of large files which are being tracked, 
   rather than transferring the entire history of large files.  LFS requires a 
   newer version of git, changes in the repository, and some extra setup for 
   support from the git server
   - A sparse checkout can reduce the disc usage of the working directory 
   by only performing a checkout of the specified subdirectories
   - Avoiding fetch of tags can reduce network transfer by not copying the 
   objects associated with tags
   - A shallow clone can reduce network data transfer by only copying a 
   subset of history into the working directory.  Depth beyond a single digit 
   value has not seemed to be any different than not having shallow clone in 
   the cases I've seen.  Shallow clone sometimes fails on older git versions 
   (like the git included with CentOS 6 and earlier)

Slides from Jenkins World 2016 that discuss several of those options are 
available at 
https://jenkins.io/files/2016/jenkins-world/large-git-repos.pdf .

If you prefer video, there is a roughly 5 minute segment on git, Jenkins, 
and large repositories in  https://www.youtube.com/watch?v=TsWkZLLU-s4 .

Mark Waite

2. Wait for Stephen...
>
>
>
> BTW, I thought the shallow cloning is basically to specify depth, so why 
> shallow:true is needed in additition to depth:1 ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5e0c22b4-dc78-4ec0-8d8e-2bba55d04276%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to