Infinite-Dango-Studios / ganbatte

A visual novel / dating sim game created with Ren'Py.
1 stars 3 forks source link

How to make changes to the repository #13

Closed ExcaliburZero closed 9 years ago

ExcaliburZero commented 9 years ago

Here I am going to do a writeup on how to make changes to the repository. I'm likely going to work on teaching this to Sabre-Hecate later today, so I though I might as well do a writeup on it as well.

Adding changes to the repository is a bit complicated, but it a very useful technique to learn. I recommend that the artists look over this, as this will be the easiest way for them to add their artwork into the game.

If anyone needs any help with learning this, then I would be happy to help.


The first thing you need to do is to create a fork of the main repository. A fork is a copy of a repository that is made into a repository on your GitHub account. This is as opposed to a clone which is a copy of a repository that exists on your local computer.

Having a fork will allow you to make changes to your local copy, push those changes into your online fork, and make a pull request to have those changes merged into the main repository.

github1 [from dataschool.io]

To make a fork you must go to the main repository (https://github.com/ExcaliburZero/ganbatte) and click on the "fork" button. This will then create a fork of the main repository on your GitHub account.

The next thing that you are going to want to do is to clone your fork onto your local computer. You are going to want to go to your online GitHub fork and get the HTTPS clone URL. This can be found in a box in the right sidebar that should say "HTTPS clone URL". Then you are going to want to run the following command in your Command Line in the directory where you want to store the game folder (to learn how to navigate between directories see here):

git clone CLONEURLHERE

That will create a local clone of your fork.

Next you should make all of the changes that you want to make to the game. Be sure to try to follow any existing formatting styles, such as naming images in all lowercase with "_" marks rather than spaces.

Then you need to add any new files to the git repo and commit all of the changes. You are going to want to open the Command Line and navigate into the directory for the game.

First you are going to want to check what files were changed by running the following command:

git status

That will let you know what files have been changed, what new files have been added, and what files have been removed. If you changed any files or added any new files then you will want to run the following command for each of the files:

git add FILENAME.FILEEXTENTION

If you removed any files then you will need to run this command for each of them:

git rm FILENAME.FILEEXTENTION

Then try running "git status" again just to make sure all changed, added, and removed files have been taken care of.

Now that you have marked the files that you have altered you can now commit your changes. A commit is a set of file changes that have a text explanation of what the changes were that were made. So essentially the commit message is used to explain what changes you made.

The first section of the commit command should contain a quick few word summary of the commit with the first letter capitalized, and no punctuation. The second section should contain a more detailed explanation of the commit, using proper punctuation and sentences.

To commit your changes you are going to want to run the following command:

git commit -m "BASICCOMMITDESCRIPTION" -m "DETAILEDCOMMITDESCRIPTION"

Once you have finished making your commit you can push your commit into your online fork. You can do this by running this command:

git push origin master

You will then need to enter your username and password, and it will then push the changes that you have made onto your online fork.

Now to move the changes from your online fork into the main online repository you need to make a pull request. A pull request is a request to the main repo owner to have the changes made in the fork merged into the main repo. Every pull request should have a descriptive name and message that tells what changes have been made. You may want to look over this page on writing a good pull request.

To make a pull request you are going to want to go to the online page for your fork and click on the green button towards the top left of the page with a symbol inside it. There should then be a button on the page that says something like "Make a Pull Request". Click on that, and create the pull request, using a descriptive title and good explanation of what the changes are. Then when you are done, click "Create Pull Request".

Then the pull request will appear on the main repository's pull request page, where it can be easily merged into the main repository.


Please let me know if this writeup was helpful, and let me know if you need any help figuring this out.

This method will work for your first pull request, however a few steps will be different for later pull requests, but I will go over those steps later, once everyone has a basic idea of how to do a pull request.


To make pull requests after you first initial one you must follow essentially the same process as before, but rather than creating and cloning a fork, you have to update you fork with the main repo.

github2 [from dataschool.io]

The first time you do this you must run the following command to setup a link to the main repo. Once you do this command once you will not need to do it again. Go to the main repo and get the HTTPS clone URL and run this command:

git remote add upstream HTTPSCLONEURLHERE

Then to update the fork at any time you must run these three commands:

git fetch upstream git merge upstream/master git push origin master

You will want to run the three commands above whenever you want to update your fork. The commands get the changes from the main repo, merge them into the local copy of your fork, and push the local copy of your fork to the online copy of your fork.

From that point on the process is essentially the same as the first time, just skipping the forking and cloning, and starting at the first running of the git status command.

ExcaliburZero commented 9 years ago

I have added more info to the main post on doing more pull requests and updating your fork.

ExcaliburZero commented 9 years ago

Since no one has made any comment on this issue, I will close it for now. If we need to make use of this issue later, then I will re-open it.