Search code examples
github

How to remove branch name from files downloaded from github


I have a repository on github for a mod for a game, some of the contained files are config files, which need to be at a very specific file path to work properly. When you download from the repository (code > download zip) the downloaded file is called reponame-main.zip how do i make it so that the branch name (-main) is not added to the end?



Solution

  • I don't believe Github lets you do that. You could possibly add it as a binary file to your release.

    You can change your repository layout so the necessary configuration folder is inside the repository. Then tell you users to unzip and copy the internal folder to their config.

    License.txt
    README.md
    TU_ExtraDockingPorts/
      Textures/
      Default/
      TU_EDP_Default.cfg
      ...
    

    When they unzip TU_ExtraDockingPorts-main.zip they'll get...

    TU_ExtraDockingPorts-main/
      License.txt
      README.md
      TU_ExtraDockingPorts/
        Textures/
        Default/
        TU_EDP_Default.cfg
        ...
    

    Tell them to copy TU_ExtraDockingPorts/ into gamedata.