-
Notifications
You must be signed in to change notification settings - Fork 5
Repository stuff
Git extensions is just a GUI into the github repository, it makes life a lot easier.
There's three things going on here really. One is learning the tools and how to participate in a coding project. The second is learning how to code. The last one is actually learning about the game system we'll be building. It's a project I've been working on for 22 years and there's a ton of lore, history and mechanics that I've never actually written down anywhere. Thankfully the system is just a system right now since I haven't gotten into any detailed game stuff in the code yet. There's still a lot of system to build before any game gets built.
The first lesson at hand, however, is repositories, which is what Git is. You can see all the commits I've been doing on the NetMUD repository. Every time something is changed, you do a commit which adds another point in the repository that we can go back to if we want to revert any changes. It also keeps us in sync with each other so we're always using the most current stuff.
Git specifically only stores Deltas which are just records of changes. If you change one line of code what Git keeps is which line changed, what it was and what it changed to. Theoretically we wont be reverting things often so the history of changes is just history; it's easier just to go into the repository history and see what was changed and reverse it in a new commit. There's other repository types (svn, cvs) that store the full files instead but they get kind of hard to store after a while due to size.
We wont be doing anything really fancy with the repository since it's just going to be the two of us. Some main concepts to understand though, since the terms git uses can get a bit confusing:
Commit - Saves any pending changes to your local repository. Until a commit occurs any changes you've made to files can be easily reverted.
Branch - Right now there's only one of these on the project, and I don't anticipate needing more than one main branch. Branches allow multiple people to be making changes to the same set of code in parallel which in theory will be merged back together into a single set of code. What we might end up doing is I'll work in a second branch and periodically merge my changes into the main one. Merging isn't always easy in Git, and this is how most professional teams work anyways with a single lead merging other code into the main branch.
Local/Remote - Once git ext is installed and we get you in the repository you'll see 2 different bubble markers. Red markers are "local" repositories, green ones are remote. Local means it is the code you have on your machine. Remote is actually what's on github. If I make a change and commit it the remote will be "ahead" of your local. If you have changes that haven't made it up there will have to be a merge done at some point to sync both sets of changes.
Fetch - Pulls down all changes made to remote branches, but doesn't change your local code.
Pull - Catches up your local code to whatever is on the remote repository and potentially merges in any un-committed changes you have.
Push - Attempts to move your local changes into the remote repository.
Merge - Attempts to automatically sync your local changes with any remote changes.