Team Spartan Cookies & Milk Forums

Full Version: Git for Starfall
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The Starfall editor on the server now supports git integration in-game. This allows you to create, commit to, push/pull and branch git repositories from the comfort of the editor.

Who is this aimed at?
This is for Starfall developers, not users. If you only use Starfall scripts, you should not worry about this module. It is a tool to aid in development. That said, if anyone decides to use GitHub or another public Git site to release their scripts, having this module will allow you to easily download them in-game, and receive updates.

Downloading the module
In order to use the git support, you need to install a binary module. The current version is attached to the post. If you don't trust me or the module, feel free to not use it. Otherwise, the zip contains a readme with installation instructions. Please make sure you read and understand everything in the readme before using the module.
[attachment=704]
SHA-256: 76f67a856efb38d73b6b2820607dad4876772d2d87b2f5e9fda47592a0ac1dc3

If you have any feedback after using the Git integration in the editor, please reply to the thread. This includes if it makes your game crash, which is possible but unlikely. If you can provide crash dumps of the issue, that is helpful. They can be found in <Steam>/steamapps/common/GarrysMod, named by their date with a .mdmp extension.

Using git in the editor
Using git in the Starfall editor should be fairly simple.

Creating a new repo
To create a new repo, right click a folder in the filebrowser, and go to Git > Create Git Repository Here.
[attachment=370]

This will add a .git folder and setup the repository in that folder. If the folder already contains files, they are not changed. So you can turn existing project folders into git repositories easily.

There's also the option to clone a repository from elsewhere. You should use this on an empty folder.

Viewing a repository's status
To view a repository's status, right click the containing folder, and go to Git > Open in Git view...
[attachment=373]

You'll be presented with a tab like this:
[attachment=371]

This tab will auto-refresh when you switch back to it after making changes, or you can click the "Refresh" button to force a refresh. On the left is the commit log, which shows all recent commits made in the repository. Clicking a commit will show you the changes made for that commit. Click the commit again to go back to current changes.

Making commits
When you want to commit changes, enter a commit summary message and if you want, a more detailed description of what you changed, then click the "Commit to <branch>" button.
[attachment=377]

Managing your signature
Every commit you make carries a signature. This signature is a name, and an email. You can change what your signature is by using the git config button at the top right of the editor.
[attachment=375]

Note that using the system default signature requires an installation of a git client configured with the name and email. Clients like GitHub for Windows will already have done this.

Branches
To manage branches, use the controls at the top left. You can switch branches using the dropdown, create a new branch using the + button, merge another branch's changes into the current, or delete the current branch.
[attachment=372]

Syncing with a remote
To sync a cloned repository with its remote, use the sync button. You can either just click it to perform a pull, then a push, or right click to choose either pull or push.
[attachment=374]

Managing remotes is planned for a future update. Note that only http(s) and git protocols are currently supported.

Planned features
The module supports all the most commonly used features of git, however there are a few missing that I plan to add in the future.
  • Stashing changes.
  • Tag management (you can create tags under the advanced menu, but not view or delete them).
  • Remote management, i.e. adding/removing remotes, changing URLs, renaming and setting remote tracking branches. Currently push/pull use "origin" as the remote, and when you attempt to switch to a remote branch a new local copy with the same name is created, linked to the remote.
  • SSH support. But this one's unlikely as getting libssh2 to build on Windows is a nightmare.
Cool. Keep up the good work.
Very cool. That is awesome!
I should point out that only #2 has loaded the Lua changes for this at the moment. #1 will load it when it next restarts.
HOLY FUCKING SHIT ITS HERE
ITS HERE!!!!!!!!
YUSSSSSSSS
Dam you starfall people, Soon as person posted this ive had 5 people telling me about it XD.

Hopefuly with this "new" way of downloading it i can learn starfall better without having to swim though the broken starfalls.
Looks awesome person keep up the great work Big Grin
nice
any way you can made this compatible for e2 aswell?
(12-09-2015, 09:21 PM)pho Wrote: [ -> ]nice
any way you can made this compatible for e2 aswell?
I'm afraid not.

Delving into the E2 editor code would be a lot of work and I don't really want to start messing with it (and then having to merge wire's changes every time they update). Sorry.
I've now added support for pushing to GitHub and other sites that require a username/password over HTTPS. It'll ask you for your details the first time you attempt to sync. The module has not been updated, so you don't need to redownload anything.

You can also use the wrench button on the far right, and choose "Set credentials". Note that this is only remembered until you close the tab.
Pages: 1 2