-1

I would like to know how to download a file in terminal may be by using wget or curl.

EDIT: I have referred some of the thread they have given version number. But I would like to download without worrying about the version number.

Siva Sankar
  • 387
  • 1
  • 2
  • 9
  • Can you explain why you want to do that? – Guenther Sep 17 '16 at 06:38
  • I am doing some kind of automation work for comparing the files with respect to their date.Instead of cloning the entire repository in another folder and getting the file it would be better if I can get it directly. – Siva Sankar Sep 17 '16 at 06:45
  • 1
    Possible duplicate of [Get a single file from a remote mercurial repository](http://stackoverflow.com/questions/5053640/get-a-single-file-from-a-remote-mercurial-repository) – Guenther Sep 17 '16 at 06:47

2 Answers2

1

Well, generally you cannot checkout single files at a certain revision without using the version control system.

If you are using some kind of web-frontend to your repository (like kallithea or hgweb) you might be able to retrieve the desired info via curl or wget

See the accepted answer in Get a single file from a remote mercurial repository (thanks Guenther!) for possible solutions, IF you have such web interface on the server.

Community
  • 1
  • 1
planetmaker
  • 5,884
  • 3
  • 28
  • 37
1

If necessary, update the remote repo to the version you are interested in. Then just fetch any files you want from the filesystem copy. E.g., if your repo path is ssh://example.com/projects/repo, you could do this:

scp user@example.com:projects/repo/main.c .
alexis
  • 48,685
  • 16
  • 101
  • 161