Jump to content

How do I set a mod up on GitHub?

Recommended Posts

I'm also v new to mod making, but I've been using git for a long time, so I might be able to help.  Is your Q more about how to use git or how to structure a mod?

As far as structure goes, I don't think there is a standard so you can organise your files how you like (but most mods seem to follow the pattern of dividing file types into separate folders which makes sense). 

As far as git and github goes....what stage are you at? Have you setup git and initialised a local repo for you code? Have you setup an ssh key for you github account?  Tell me where you're at and I can tell you what the next steps are.


Link to comment
Share on other sites

I've got the repository shell set up. I am using Microsoft Visual Studio, but have not yet linked the two together. The mod is just a DLL, so not much work there.

I also need to figure out how to reset the KSPAVC so it won't give me errors...

I'm eager to learn...

Link to comment
Share on other sites

I'm guessing MS visual studio takes care of some of the process of committing code to the local repo for you.  If not then open up a terminal in your mod's folder (with windows I think you can right click and select "git bash here" IIRC).  run "git status" to check if everything is committed, you should see something like;

On branch master
nothing to commit, working directory clean

If not then run git add <path to files(s)> 
and then git commit -m "some commit message"
(if the files are already tracked then git add -u will do, or of you're adding new files git add ./ but careful with that as it will add everything, so unless you've setup a .gitignore file that may add more than you want....you don't want to add the actual .dll file to the repo btw, just the source code and any assets).

I prefer to setup an ssh key and add that to my github account so I don't have to keep bashing my password in, but I'm not sure what's needed to do that under windows (but there's a guide here). But you don't have to use ssh, you can use https instead.  

Go to github and create a new repo and just give it a name, don't tick the add readme option. Github will then give you a bunch of commands to choose from.  You want to click on the "https" button at the top (unless you've setup an ssh key) and then run the commands under the "or push an existing repo..." section. Will be something like;

git remote add origin https://github.com/<your_username>/<repo_name>.git
git push -u origin master

The first line adds the remote reference and the second one pushes your local master branch to the master branch on the github repo. And that's it as far as pushing the code goes. From them on when you make changes add and commit them (git add -u followed by git commit -m "some message") and then "git push origin master" to push them to github. 

Once you've done that you'll want to create a release.  Easiest way is click "releases" at the top of you repo on github and then click "draft new release".  Give it a version (tag), a title and any description you want.  Then create a zip containing the mod and drop it onto the "attach binaries" section.  Click publish and that's it.
fyi you can always link to your latest release with 


Hope that helps! (would have answered sooner, but I made a typo right at the end, hit ctrl+z and this wonderful forum software nuked everything I'd written, thanks forum!)


46 minutes ago, adsii1970 said:

I also need to figure out how to reset the KSPAVC so it won't give me errors..

That I don't know.

Edited by katateochi
edited because it's passed midnight and apparently half my brain is alseep
Link to comment
Share on other sites

Ok, I tinkered with the KSPAVC and it now is showing as a "current mod". If you want, I'll share the easy way to do this.

Secondly, I have the stuff uploaded, but when I download it to test it, the folder has a "- master" tag on it. How can I go about moving this so the mod is simply drop the folder into game data and play?

Link to comment
Share on other sites

22 minutes ago, adsii1970 said:

but when I download it to test it, the folder has a "- master" tag on it.

Are you clicking on the green "Clone or download" button (bottom right of this image)?
That will download the actual repo, and will tag it with whatever branch is selected.
To make the mod available to others, click on the "releases" link (top left in above image) and then draft and publish a release (and in that you can attach a zip file with just the required mod files for use) and then direct people to the release, rather than to the repo itself. Think of it as two separate things; the repo to host the source code (and make it publicly available) and the releases for the usable product.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...