Question

When I download the master.zip of my project on GitHub I get a .zip file containing a folder named something-master that contains all the source code.

Is it possible to download the master.zip in a way that the whole sourcecode is in the "root" of the zip without subfolder?

Was it helpful?

Solution 2

something is the name of the repository.

As the zip file is built by GitHub, you cannot customize the way it's done just clicking on the download button. Anyhow you can always unzip everything in the same directory (discarding any subfolder) running this command:

unzip -j something-master.zip

from terminal/console

OTHER TIPS

No, but if you download the tar.gz (as file 'master') instead of the zip, you can extract it in any folder you want without the top folder:

tar xvf master -C yourFolder --strip-components 1

@VonC's answer did the trick. All together:

Download the repo via tar file:

curl -L -o reponame.tar.gz https://github.com/username/reponame/archive/master.tar.gz

Extract without the top directory to YourTargetDir:

tar xvf reponame.tar.gz -C YourTargetDir --strip-components 1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top