I would like to learn more about this code, but I am not able to import it into my computer. How could I clone this file with git? The file is simply:
Thanks!
13 Answers
You can get that file using wget:
Create a directory:
mkdir mypycodeChange into that directory:
cd mypycodeIdentify the raw URL
- Navigate to your file on github (or your git host)
- Click on the Raw tab.
Use
wgetto download it:wget
I suggest the following command :
git archive --remote=:foo/bar.git HEAD | tar xvf - path/to 1 You can't clone a single file using git.
Git is a distributed version control system, the Idea behind its clone functionality is to have a complete copy of project and all versions of files related to that project.
Either download your file directly from here or clone the whole project using:
clone Also from here:
3If there is web interface deployed (like gitweb, cgit, Gitorious, ginatra), you can use it to download single file ('raw' or 'plain' view).
If other side enabled it, you can use git archive's '--remote=' option (and possibly limit it to a directory given file resides in), for example:
$ git archive --remote=:foo/bar.git --prefix=path/to/ HEAD:path/to/ | tar xvf -