Skip to content
jwapobie edited this page May 15, 2020 · 6 revisions

Intro to Git

Git is a source version control manager. It tracks the history of code, synchronizes your computer's copy with an online copy, allows collaborators to work independently and merge their changes together, and is generally a pain in the butt.

There are multiple ways to use Git. My method is to use a combination of the command line interface, downloadable here, and Sublime Merge for any heavy lifting / merging.

A folder tracked by Git is called a repository. The online repository hosted by GitHub is called remote, your computer's copy is called local. You can clone this repository to your computer with git clone https://github.com/jwapobie/artstation.git.

Branches

Branches store different "versions" of the code. You can switch between them with git checkout <branchname> as long as you don't have pending changes. You can make a new branch based off the active one with git branch <branchname>. This lets you do your work in peace without remote changes messing you up. When done, work from your branch can be copied back into the original.

Branches in this repo

  • Master: A copy of tgstation/master. This contains no custom assets.
  • artstation: The stable build of artstation. This branch contains all custom assets and should be working most of the time.
  • art-latest: Whenever we want to upgrade to the latest version of tgstation/master, do it in here so that it doesn't break the artstation branch.

Committing

A commit is a discrete unit of work, like a unique version of the code. Every time you make a change, it will show up as a pending item when you run git status. Use git add or a Git GUI tool like Sublime Merge to queue your changes for commit, then run git commit -m "<commit message>" to save your changes. Then, push your changes.

Pushing and Pulling

Pulling is the act of updating your local repository to match the remote. Do this constantly, especially before you make changes. Pushing is when you push your local changes up to the remote repository. This updates the repository on GitHub.

Clone this wiki locally