How to retrive a single file from github using git

You can get that file using wget:

  1. Create a directory:

     mkdir mypycode
    
  2. Change into that directory:

     cd mypycode
    
  3. Identify the raw URL

  • Navigate to your file on github (or your git host)
  • Click on the Raw tab.
  1. Use wget to download it:

     wget https://raw.githubusercontent.com/tensorflow/tensorflow/r1.1/tensorflow/examples/tutorials/mnist/mnist_softmax.py
    

I suggest the following command :

git archive [email protected]:foo/bar.git HEAD |  tar xvf - path/to

Tags:

Git

Clone