STICKY: Contributing with Git

Old support forum threads relating to this project

STICKY: Contributing with Git

Postby Viaron » November 26th, 2013, 9:41 am

Notice: This Guide has some out of date materials. Our repository is located at https://github.com/swganh -- not /anhstudios. Other than that, all information is accurate.


At the heart of GitHub is an open source version control system (VCS) called Git*. Created by the same team that created Linux, Git is responsible for everything GitHub related that happens locally on your computer.

Download and install the latest version of Git..

Use the default options for each step.

Setup Git

Now that you have Git installed, it's time to configure your settings. To do this you need to open Git Bash (not the Windows command line).

Git Configuration

Username

First you need to tell git your name, so that it can properly label the commits you make.

Code: Select all
git config --global user.name "Your Hame Here"
# Sets the default name for git to use when you commit


Email

Git saves your email address into the commits you make. We use the email address to associate your commits with your GitHub account.

Code: Select all
git config --global user.email "your_email@example.com"
# Sets the default email for git to use when you commit


Your email address for Git should be the same one associated with your GitHub account. If it is not, see this guide for help adding additional emails to your GitHub account. If you want to keep your email address hidden, this guide may be useful to you.

Password caching

The last option we need to set will tell git that you don't want to type your username and password every time you talk to a remote server.

Tip: You need git 1.7.10 or newer to use the credential helper To use this option, you need install a credential helper.

GitHub for Windows includes this helper, and provides a git shell so you don't need to install and configure git manually.

If you don't want to use GitHub for Windows, you can download the helper for your OS here:

Windows Vista, 7, & 8 (.NET 4.0 required) Source Unzip the file and run the git-credential-winstore.exe program inside. This will start up the helper and update your git config to use it.

--

The process you are about to preform is to fork a repository. Which makes a copy of it for your Github account. While SWGANH is open source, we do not allow direct commits. This is so developers can review the accuracy of the code. Accuracy can be a multitude of things, including: It's functionality, It's ability to perform, If it has bugs, or even if it is content is before publish 14.1.

Forking a Repository

To start, you need to fork the repository you want to work with. In this instance we will say it is "swganh", the main server core. Forking adds a copy of the repository to your account. It is the first step in contributing.

Image

Cloning your Repository

The next step is to clone your repository with Git. This is downloading it to your computer. To do so, run the following code.

Code: Select all
cd C:/Users/your-user-account/where-ever-you-want-your-repository
# Goes to that specified location. That is where your files will get downloaded too.
git clone https://github.com/**your-username**/swganh.git
# Clones your fork of the repository into the current directory in terminal


Committing

After you have changed a file in the source or added some content and you wish to submit it to be reviewed by the Developers, you can make a commit.

Code: Select all
git status
# lists the status of the master. Telling you what files are different from the current public
# repository on github (if you used "cd C:/your-origin-whatever")


Find the files you want to change and type:

Code: Select all
git add path-to-file.file-type
# Adds the specified files.


If you alter multiple files and want to commit all of them, you can use:

Code: Select all
git add *


If you delete a file and want it to be completley removed/deleted from the repository when you commit, you can use:

Code: Select all
git rm * (or git rm path-to-file.file-type

Then when you are ready to commit:

Submitting a Pull Request

When you have a commit, or more than one commit ready to be sent for review you need to submit a "Pull Request" so developers can preview your changes, then approve or decline it. Do that on this page:

https://github.com/anhstudios/swganh/compare
Last edited by neroplat on February 27th, 2014, 12:09 am, edited 1 time in total.
Reason: Red Note!
Viaron
Retired Staff
Star Wars Galaxies: A New Hope
There is another...
User avatar
Viaron
Retired SWG:ANH Staff
 
Posts: 133
Joined: August 5th, 2012, 8:49 pm
SWG Official Server: Farstar

Return to SWG:ANH :: Archive Forum :: GAMESERVER

Who is online

Users browsing this forum: No registered users and 0 guests

cron