Answer the question
In order to leave comments, you need to log in
Git. Pull a specific file from the repository
Hello. How to pull a specific file or directory from a git repository without cloning the entire repository?
For example, the situation is this:
there is a local repository. It was corrected by hand and did not commit/delete/otherwise corrupt the file. There is a conflict when trying to do a git pull. Everything? Is life over? Need to re-clone the repository?
I saw this . But it doesn't work.
Deleted the index.html file in the local repository. I'm trying to restore:
"test" is a comment to the commit with which the index.html file was launched into the repository.
Tried with colon:
[email protected]:~/repos/projectname$ git show HEAD -- index.html
commit 7799d08a68166795f1fa33f4faf3435469439cd7
Author: Name Soname <[email protected]>
Date: Wed May 18 18:56:43 2011 +0400
test
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/index.html
@@ -0,0 +1 @@
+test
[email protected]:~/repos/projectname$ git show HEAD:index.html
test
Answer the question
In order to leave comments, you need to log in
there is a local repository. It was corrected by hand and did not commit/delete/otherwise corrupt the file. There is a conflict when trying to do a git pull. Everything? Is life over? Need to re-clone the repository?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question