Git Setup
git is what the PCGen uses to track changes and move those changes to our git repository on github.com.
For Linux and Mac users, you will need to download/install git for you operating system.
Windows machines:
- Download git and install it -- LINK: https://git-scm.com/downloads
- You can use command line, or a git client. However, the programs the team uses are SourceTree and the TortoiseGit Windows Shell Interface
We will want to create a SSH key. This can be accomplished using PuttyGen, which comes with TortoiseGit or is a standalone download here
Create the Key, you will move your mouse to seed randomness. Once that is done, the window will have a KEY. Save the Private key somewhere easy to remember, like Documents/keys. Copy the public portion (Entire window), we'll be using that in a moment.
Next, you will need a GitHub account.
Once you have an account, click here to go to your settings/keys
Create a NEW SSH KEY
Paste the key, and name it, click okay/save.
After that, you will want to have a copy of the PCGen Project, click on this to FORK a copy of the PCGen development and click here for the NewSource Development
After you have Forked, the green Button Clone or Download will have a LINK. Example: git@github.com:PCGen/pcgen.git or if you desire git@github.com:<YourUserName>/pcgen.git
Copy that LINK.
Next, you'll want to clone that repository onto your computer. I recommend a folder set aside for these repos. Like c:\Projects\PCGen. If using tortoisegit, right click while inside the destination folder and select 'Git Clone here'. If you copied the Github Clone link, then tortoisegit has already placed that link for the URL.
Check the Load Putty Key and give it the path to your key you created. Verify the destination is correct, and then click okay. Repeat the Git clone process for every repo you want to have available.
Contribute Work
If you are going to edit and work on files for inclusion in the next release, then you need to become familiar with the terms used and the workflow.
- Branch - A named branch to edit files in. (Always do changes in a branch). PCGen standards are name branchs for the JIRA you are working on. Each feature or bug gets a separate branch.
- Switch/Checkout - Method to change branch
- Add - Adds files to the git stage
- Commit - Takes the 'added' files and takes a snapshot of the changes
- Push - Takes all the snapshots in the branch, and "pushes" those changes to a remote repository (In this case, your repository on github.com)
- Pull Request (PR) - How to get your branch and changes to be seen by the upstream repository (PCGen/pcgen or PCGen/pcgen-Newsource).
- Merged - What takes place when two branches combine into each other. Each branch needs to eventually merge into the master to be seen for the releases.
- Fetch - Used to grab the list of another remote repository branch list
- Pull - Pull changes from the selected repository into the current selected branch
- Rebase - Used during a Pull/Fetch to reorder the commits you have made, and place them after the existing commits.
ALL work takes place on your computer. You host a local repository on your computer. You add/commit to save those changes. PUSH and PULL REQUEST are the methods to move your changes into the internet and share your changes with the team.