Is there a way to fork a file from a foreign Git repository without cloning the whole repository?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The closest you could get to doing this is by using sparse checkout, which means using Git 1.7+ and you still need to clone the repo (or use
clone‘s--depthoption to do a shallow clone). Borrowing largely from this answer, you could do the following:If you have Git version 1.7.7-rc0 or later, you can set configuration options with the
clonecommand:Also, see the following: