The git plugin doesn't provide an exact match for your use case, but there
are some things you can configure in the plugin which may still help you
achieve your stated goal "to help save time spent in cloning everything
from remote repos".

The "Advanced clone behaviours" section in the "Additional Behaviours"
section of the plugin configuration will allow you to define a "shallow
clone".  A shallow clone only copies the most recent commits, to the depth
specified in the depth parameter.  Copying fewer commits in the repository
history can significantly reduce the time to clone.  Many build processes
don't need access to the full history of the repository, so the local
Jenkins workspace copy can be a shallow clone.  Refer to the command line
git documentation for more information on shallow clone.

The "Advanced clone behaviours" section in the "Additional Behaviours"
section of the plugin configuration will allow you to define a "reference
repository".  A reference repository is a bare copy of the repository
stored on a local file system.  When git clone is given a reference
repository during its initial clone, it will create pointers to the content
in the reference repository rather than copying the content from the remote
repository.  Pointers to the content can significantly reduce local disc
usage for repository history and can significantly reduce the time to clone.

You may also want to consider mirroring the repo more frequently.  Git is
quite efficient at only copying the new content, so a mirror process that
runs every few minutes is probably no worse than Jenkins copying the
content into a workspace.

Thanks,
Mark Waite

On Thu, Jun 16, 2016 at 5:19 AM Milan Satpathy <satpathy.mila...@gmail.com>
wrote:

> We had a job to poll and fetch updates from a remote git repo. Recently we
> have a mirror repo set locally.
> But the locally set repo lags behind the remote one by an hour or so.
>
> So the idea was to re-configure the jenkins job in such a way that:
>
> 1) it clones from the locally set repo first ( if the workspace is deleted
> and needs to be re-created)
> 2) and then pull only the recent changes from the remote job on top of it
>
> This is to help save time spent in cloning everything from remote repos.
>
> Please suggest how to achieve this using a jekins job configuration.
>
> --
> 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/c6226af0-a8eb-42f5-8357-24cf871f6f31%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/c6226af0-a8eb-42f5-8357-24cf871f6f31%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAO49JtF-fB%2BDOgZERYHwgVTmmoEWqOQccvy7r6_cf9peWNu2yA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to