Re: Sparse Checkout in GIT

1,864 views
Skip to first unread message
Message has been deleted

Mark Waite

unread,
Jul 14, 2014, 8:58:54 AM7/14/14
to jenkins...@googlegroups.com
Yes, it is.  You'll need a git version which supports sparse checkout, and a recent version of git-client-plugin and a recent version of git-plugin.

Once you have those pre-requisites, then you click the "Add" button in "Additional Behaviours" and select "Sparse Checkout paths".  We use it very often.  It works well for us.

Mark Waite


On Mon, Jul 14, 2014 at 6:49 AM, sai ram <sair...@gmail.com> wrote:
Hi,

I want to checkout a particular folder from GIT repo. Please let me know if this is possible in the latest GIT version.

Thanks,
Sairam

--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite
Message has been deleted

Mark Waite

unread,
Jul 14, 2014, 9:10:56 AM7/14/14
to jenkins...@googlegroups.com
Check that your git repository actually contains a commit with SHA1 faaf2c4ff254904ca0692a69270b9d342cd8a637 .

If it does, then check that the repository which Jenkins is using actually contains a commit with SHA1 faaf2c4ff254904ca0692a69270b9d342cd8a637.

Assure that you are not using "shallow clone" in the Jenkins repository, since a shallow clone may not include the SHA1 you're trying to use.


On Mon, Jul 14, 2014 at 7:01 AM, sai ram <sair...@gmail.com> wrote:
Please help me out with this error,

Command "git read-tree -mu HEAD" returned status code 128:
stdout: 
stderr: fatal: Not a valid object name HEAD

.
.
FATAL: Could not checkout null with start point faaf2c4ff254904ca0692a69270b9d342cd8a637 hudson.plugins.git.GitException: Could not checkout null with start point faaf2c4ff254904ca0692a69270b9d342cd8a637
.
.
Caused by: hudson.plugins.git.GitException: Command "git checkout -f faaf2c4ff254904ca0692a69270b9d342cd8a637" returned status code 128: stdout: stderr: error: Sparse checkout leaves no entry on working directory

.


Kind Regards,
Sairam
9884699987 | Skype - vjsairam



--
Thanks!
Mark Waite
Message has been deleted

Mark Waite

unread,
Jul 14, 2014, 9:35:41 AM7/14/14
to jenkins...@googlegroups.com
If directoryA is a parent of directoryB and you only want directoryB, then you would list directoryA/directoryB in the sparse checkouts field.


On Mon, Jul 14, 2014 at 7:20 AM, sai ram <sair...@gmail.com> wrote:
Thanks Mark. Will give a try. Could you please let me know what path should I give in the sparse checkout if my project setup is as below,

Root
--- Project A
   ---- Project B

I want to sparse checkout Project B



Kind Regards,
Sairam
9884699987 | Skype - vjsairam





--
Thanks!
Mark Waite
Message has been deleted

Mark Waite

unread,
Jul 16, 2014, 7:39:05 AM7/16/14
to jenkins...@googlegroups.com
I don't understand what you mean by dynamic file.

Git does not have a concept of a file kept in one location in the repository and moved to another during checkout, at least not as far as I know.

I guess you could copy the file as part of your build script, but there is no way to make that part of the checkout.

Mark Waite


On Tue, Jul 15, 2014 at 11:06 PM, sai ram <sair...@gmail.com> wrote:
When I do a sparse checkout, then in the Jenkins workspace I see,

ProjectA/ProjectB

but I want to create a dynamic file that has be moved inside the ProjectB and currently its located under,

ProjectA/ProjectB
abc.xml

Please let me know how to do sparse checkout for this.

Thanks,



--
Thanks!
Mark Waite

bandi pavankumar reddy

unread,
Jul 16, 2014, 8:10:20 AM7/16/14
to jenkins...@googlegroups.com
Hi mark i am trying to clone git repository in Jenkins it's not cloning and displaying time out error ....give me any suggestion and one more thing my repository is large repository and size is 16GB  and very big repository how can i clone in jenkins 
how to  set the build timeout in jenkins ..... 
 
.....> C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress g...@000.00.000.00:ppp_PR_SOURCE.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress g...@000.00.000.00:ppp_PR_SOURCE.git 
stderr: remote: Counting objects: 245798   [K
remote: Counting objects: 395509   [K
remote: Counting objects: 503084, done. [K
remote: Compressing objects:   0% (1/170398)   [K
remote: Compressing objects:   1% (1704/170398)   [K
remote: Compressing objects:   2% (3408/170398)   [K
remote: Compressing objects:   3% (5112/170398)   [K

 
Message has been deleted

Mark Waite

unread,
Jul 16, 2014, 8:32:43 AM7/16/14
to jenkins...@googlegroups.com
If you create the file yourself, then why not create the file in the directory where you want it?  

Alternately, why not copy it into the place where you want it with the same program or build step which created the file?


On Wed, Jul 16, 2014 at 6:18 AM, sai ram <sair...@gmail.com> wrote:
The dynamic file is not associated with the repo. We create a dynamic testng file and refer the test class in that. so the testng file should reside inside the repo.

Kind Regards,
Sairam
9884699987 | Skype - vjsairam





--
Thanks!
Mark Waite
Message has been deleted

Mark Waite

unread,
Jul 16, 2014, 8:49:58 AM7/16/14
to jenkins...@googlegroups.com
You could add a build step to the job which copies the file before the step which performs the build.


On Wed, Jul 16, 2014 at 6:38 AM, sai ram <sair...@gmail.com> wrote:
We do not have privileges to change the source code of the testng file creation and it.

The file is created to the workspace directory on the run time by taking the string parameters from Jenkins.

is there any workaround for this ?

Kind Regards,
Sairam
9884699987 | Skype - vjsairam





--
Thanks!
Mark Waite
Message has been deleted
Message has been deleted

Mark Waite

unread,
Oct 6, 2014, 1:54:01 PM10/6/14
to jenkins...@googlegroups.com
I'm not a list administrator.  I can't delete a posting.  I'm not sure if Google Groups supports deletion.

Mark Waite

On Mon, Oct 6, 2014 at 11:20 AM, sai ram <sair...@gmail.com> wrote:
Mark,

Could you please do me a favor ??? This post includes my signature which is displayed in public. Could you please delete this ??

Thanks,
Sairam



--
Thanks!
Mark Waite

Richard Bywater

unread,
Oct 6, 2014, 2:03:12 PM10/6/14
to jenkins...@googlegroups.com

Even if it did people who received the email via mailing list like myself still have access anyway so if there's something that you have now had compromised, now's a good time to change it :)

Richard.

Reply all
Reply to author
Forward
0 new messages