Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
14.6k views
by
edited by
We are using Git as our SCM. I would like to clone or checkout specific directory, not the whole project in Git. Can you guide me on how to checkout or clone specific directory from Git repository via command line and Jenkins? What plugin should I be using with Jenkins?

2 Answers

0 like 0 dislike
by The go-to Tester (181 points)
selected by
 
Best answer

You can not really clone specific directory from git repository, you need to download whole repository. But, you can checkout specific folder or file from your commit or branch.

Eg command,

git checkout branch_or_version -- path/file

To checkout specific file from the branch.

git checkout HEAD -- main.c

to checkout specific folder from the commit.

git checkout e5224c883a490f11c1f1cb2b2f2aae9d4ce17ac9 /path/to/directory

To checkout specific folder or file on Jenkins, you can utilize MSEM Plugin. In that you can define your directory or file into sparse checkout field.

by (-9 points)
Hiiii... How are you all,

Please anyone help me on this...Actually I am new to jenkins...I am trying to download the specific folder from my Git hub repository .Actual Repository URL is :  ssh://[email protected]/vcs00p10/repo/wincaredev/WINCareCRM-Account-Functions.git


While i am trying to new cloning or new checkout from Source Tree i used to pass the aboove url and try to cloning successfully.

once it is successfully cloning it will be download the complete code under  C:\g-acc\apps\WINbizCRM-CI-SEL\Code  this directory.

I am trying to download only "WINbizCRM-CI-SEL" folder from repository in jenkin.

what i need to chnage or how to download only the specific folder from git in jenkin.

For your information under jenkins -->configuration--->Sourcecode management--->i disabled the additional behaviours--->choose only for the "Checkout to a subdirectory" and given the Local subdirectory for repo as "WINbizCRM-CI-SEL". But its download all the repository under WINbizCRM-CI-SEL this folder.

It just create the folder and download again complte repository as like "C:\g-acc\apps\WINbizCRM-CI-SEL\Code" ...

I just want to download only "\WINbizCRM-CI-SEL\Code"

I hope now you understand what i am looking for .....Please help me on this



Read more: https://softwaretestingboard.com/qna/1791/how-clone-checkout-specific-directory-command-line-jenkins#ixzz5V2OnYNb1
0 like 1 dislike
by (-9 points)

Hiiii... How are you all,

Please anyone help me on this...Actually I am new to jenkins...I am trying to download the specific folder from my Git hub repository .Actual Repository URL is :  ssh://[email protected]/vcs00p10/repo/wincaredev/WINCareCRM-Account-Functions.git


While i am trying to new cloning or new checkout from Source Tree i used to pass the aboove url and try to cloning successfully.

once it is successfully cloning it will be download the complete code under  C:\g-acc\apps\WINbizCRM-CI-SEL\Code  this directory.

I am trying to download only "WINbizCRM-CI-SEL" folder from repository in jenkin.

what i need to chnage or how to download only the specific folder from git in jenkin.

For your information under jenkins -->configuration--->Sourcecode management--->i disabled the additional behaviours--->choose only for the "Checkout to a subdirectory" and given the Local subdirectory for repo as "WINbizCRM-CI-SEL". But its download all the repository under WINbizCRM-CI-SEL this folder.

It just create the folder and download again complte repository as like "C:\g-acc\apps\WINbizCRM-CI-SEL\Code" ...

I just want to download only "\WINbizCRM-CI-SEL\Code"

I hope now you understand what i am looking for .....Please help me on this

by The go-to Tester (142 points)
Hi Faizazn,

What you have posted is a question and not a solution.

I suggest you go to ask page and post your question to get solutions.

https://softwaretestingboard.com/qna/ask


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...