문제

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?

도움이 되었습니까?

해결책 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

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top