Partial clone with Git and Mercurial
I switched into the specific directory into which I'd like my repo file to be copied into, and then tried the following:
git clone email@example.com:path/to/file.java
but it's giving me ERROR: repository not found
Can anyone tell me what's going on, and what's the right thing to do? (a little background doesn't hurt!)
You may want to look into something called a sparse checkout which was implemented in Git 1.7 I believe. Before that I don't think git allowed you to do so although on github you can always copy individual files from their web interface by opening the file and saving it.
git works at the repository level, not at the file level (unlike CVS/SVN).
As a result, if you clone you usually clone the whole repo - and a change is tracked as a repository content change - not a simple file change.