Center for Open Source Stonehearth Modding [Tutorial]


#1

I was interested in creating a mod that was open-source, so others can contribute to it, but also so people can see it and use the code and stuff in there own projects. So I created this tutorial for setting up a Github repository, telling Git where your files are on your PC and also pushing it to the repo. I am still fairly new to Git myself, but I thought I would share what I have.

Here it is:

  1. Download and install Git from here: Git - Downloads Also create an account on GitHub here: https://github.com/

  2. Create a folder on your PC where you will put your project files. Basically a folder that you will have all of your mod files in.

  3. Go to github and in the top right, click on the + icon and click create repository.

  4. Fill in a name, pick a license and check the “Initiate With Readme” box.

  5. In the bottom right there is a place where it says HTTPS clone URL, click on the little clipboard to copy the link to your clipboard.

  6. Go to your folder you created in step 2. and press Shift + Right click. Clikc the open command prompt button.

  7. In command prompt type the following: git clone insertTheLinkYouCopiedHere and hit enter. Then you can type exit and hit enter when it is done. It should have created a folder with the name of your repository! Congratz, you now have a repo on github and it is cloned to your desktop!

In order to push (Send) your changes that you made in this folder to GitHub for people to see follow these steps:

  1. Navigate to the folder that Git created that has the same name as your repo and right click. Click the “Git add all files now” button.

  2. Now, right click in the same folder and click “Git Commit Tool”.

  3. A window should appear. First type in a commit message. (This can be anything, but should tell what changes you made.) In the bottom left click the commit button. The window should then close.

  4. Right click in that same folder and click Git Bash

  5. In the console that appears type the following: git push

  6. It will then ask for your username for github. type it in properly and hit enter. Then it will ask for your password for github. Enter it in very carefully and hit enter. (Note when you type your password in it will not show any characters, so type carefully)

Congratz, you will now have made a repository and pushed some changes to it. I hope this will help and encourage others to go open-source, that way we can all share our knowledge. If you have any questions please ask.

Also, if you ever make a change to the files online, instead of on your local repo, then open Git bash as above and type git pull and hit enter. It will check for any changes in the online repo and “pull” them down to your local repo.

If you link your repo/account profile page below and @Nicedude80 me I’ll add you to the below list of repos.

Nicedude80’s: nicedude80 · GitHub

If you liked my tutorial please consider donating to me here: Nicedude80 is creating mods, websites and other things. | Patreon


#2

This is my repo if you want to see an example: GitHub - nicedude80/Project1


#3

Nice tutorial. I might try it tomorrow.


#4

It’s a really nice way to share yours mods, but it is also VERY helpful because more experienced moderns can just go on there directly help you. Now I don’t 100% that system but I think you basically make a local copy the same way you do your own repos, but when you do git push --all it doesn’t actually go to the code, it just sits in a que where the owner of the repo can allow your push to go threw if he likes what you did. It can be very useful.

Edit: @Miturion if you need any help at all, just ask. Also I can post your profile link above if you want.


#5

I actually installed github way back in January. But forgot about it. :blush:
I dont have any active commits.


#6

@Miturion Don’t be confused with GitHub app and Git. My tutorial doesn’t support the github windows app. You have to install Git. Github is just a server where the repos are stored.


#7

I can do this also with github. Make clones ad repos. As far as I have seen.


#8

Sorry, I was talking in terms of my tutorial. You can use GitHub app, it’s just my tutorial won’t make sense. I am not using GitHub’s software, just their server. I am using git and the command line.


#9

Does your way make it possible to have private repo’s? That would be a great.


#10

Private git repositories are kind of a pain in the arse - at least if you want them to be reachable over the internet (i.e. not some kind of network/VPN).

For all intents and purposes, I would wholeheartedly recommend GitHub as hoster. The private hosting option is available as subscription and offers you everything that public repositories have too, all the goodies.


#11

I see bitbucket can make free ones. I try that one first.


#12

Well that is one downside to github. You have to upgrade your account to a paid one to use private repos. I am 80% sure that the tutorial will apply to bit bucket as well, just I don’t know where the http URL thing is. That is probably the only difference.