-1

I've cloned my repository via git clone, and now I want to checkout a folder.

Source folder: /opt/XYZ/foldertochecout

and it should be checked out to

/var/www/foldertochecout 

Is that possible and how?

0

1 Answer 1

6

git checkout allows specifying a path after the -- argument separator. So for example, this will check out only that directory:

git checkout HEAD -- opt/XYZ/foldertocheckout

(assuming that opt/XYZ/ is also part of your repository—although that seems a bit unlikely and XYZ is probably your repository directory)

Sign up to request clarification or add additional context in comments.

1 Comment

this is the reopository: /opt/XYZ and the foldertochecout is a subfolder in the repository. and I want to check it out in the apach folder under /var/www/destination

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.