SRL Archive - Outdated Tutorials

Introduction to Git


Train

2011-02-21 02:38:27

Introduction to Git
How to use it and it's purpose, for regular users and developers.
Please note that this tutorial is intended for Windows users.

Git is…
  • Fast
  • Free
  • Open source

Git, a version control system, is an alternative program to subversion. Git, however, is more advanced and appeals to a developer on higher levels, offering full repository history while offline and simple-to-use merging while opening up to a wide range of developers via the fork system.

However, Git can be hard to use for the average user, and can be simplified by downloading an user interface embedding Git.

Obtaining Git
Git can be downloaded from here, or choose the link below that corresponds to your operating system.
Please note that the table below may be outdated and it is wiser to use the above link.

Once you've downloaded your installer, you can proceed to install the application. This should be self explanatory, but if not, I will describe how to do so on Windows.

Open the installer and navigate your way through until you get to "Adjusting your PATH environment". You should be presented with three options. If you're a developer, it would be wise to choose the second one (Run Git from the Windows Command Prompt), however, if you're a normal user or a new-developer, feel free to leave it as default (the first one).
Proceed to make your way through the rest of the installer and install with default values.
Once Git has installed it would be a good idea to restart your computer.

Installing an User Interface
A great free user interface is TortoiseGit.
To download TortoiseGit, please visit this page or click this direct download link.
Once the installer has downloaded, open it and let it guide you through the installation (keep default values).
Once the installation is completed you should restart your computer.

Obtaining and Keeping a Repository Updated
In this segment, you will learn how to download and keep a repository updated. We will be using srl-reflection as an example.
First, create a folder called "Reflection" in your Simba includes folder.
Next, you need to get the Git clone URL. You can do this by going to the main repositories github page and copying the link.

Next, you will want to right click the Reflection folder and click "Git Clone…"


A window titled "Git clone" should pop up, paste in the Git clone link and then remove the trailing folder in Directory input.


Click OK and let it Clone the repository. When it's done you should see a window like so, and click Close.


Congratulations! You've obtained a clone of srl-reflection!
Now, here comes the simple part. To keep the repository updated, periodically right click the directory and select "Git pull", this will pull all new updates to your local clone.


Click OK to the Pull window that appears, and you should see a window something like this when it's done updating, click close and you're good to go!


Developers
Using Git as a developer is extraordinary. Git has the ability to work offline (unlike a non-local subversion control) and that enables itself to be able to execute (all) commands faster than subversion. Git also has an excellent merging process. Files can be merged together from almost any version of the repository, regardless of how outdated the clone is. This appeals to a developer more because [with multiple people], some may make changes, but be a repository or five behind.

For this segment, I will be using RRL as an example.

First, create your folder and clone the repository of your choosing, if you do not know how to do this, please read until you do under "Obtaining and Keeping a Repository Updated".

Uploading changes
Every time you change a file, it should become a red file with an exclamation mark, signifying that it's modified.
To commit changes, you simply go to "TortoiseGit > Git Commit -> "master". Select the files you wish to commit locally, enter a message, and click OK.


When it's completed, click Close on the opened dialogue.

Please note. When you commit all your changes you're able to update your repository without losing them (the changes), as they will be merged (with any new updates). You run the risk of losing your changes if you don't commit them locally (plus, it shouldn't be allowed). NO COMMITED CHANGES ARE LIVE UNTIL YOU PUSH TO THE SERVER!

When you're ready to make the changes live, or you regain internet access, right-click and select Git Push. Enter your password to your github account and let the magic happen. Click Close when it's finished.


Updating the repository
When updating the repository, you may have some un-pushed commits. Before updating, make sure all changes are commited to your local repository. Right click the folder and select Git pull. This will initiate an update sequence of your clone, please note that any password requested is your Github password.

Once updated, all files should be merged respectfully. If there are any conflicts, you can easily resolve them by right clicking and selecting "Resolve" under the TortoiseGit menu.

Please Note. After updating to the latest push, you will be allowed to push commits to the server.



Accepting a pull request
Coming soon.

Tips & Tricks
Optimizing your right-click context menu for user friendliness.
Coming soon.

Gu3st...

2011-02-21 02:39:34

This is very much needed! :D

Good job, and thanks! :) rep+

Echo_

2011-02-21 06:04:55

Nice tut, I needed this :)

TomTuff

2011-02-21 06:19:03

Rep+

I've been wondering if there was a gui for git!

Naum

2011-02-21 06:38:55

Awesome man, really needed this :). rep+

Train

2011-02-21 07:14:17

Thanks guys, added [part of] the developers section! :)

NCDS

2011-02-21 11:00:14

Yeah, this really couldn't have come at a better time. Nice job.

Nava2

2011-02-21 11:43:03

Nice.

I really suggest learning how to use git-bash though rather than tortoise git..

Also, you should link to the actual git tutorials out there.

Wizzup?

2011-02-21 11:53:16

For those interested in console based, I wrote a quick tutorial too. (it assumes you've previously used svn)
http://villavu.com/forum/showthread.php?t=55618

Train

2011-02-21 14:03:18

@Nava2: Well, tbh, I wrote this off my personal experience with the program, I honestly have no idea where the official tutorial is.
@Wizzup?: Cool :), I was planning to add my own section like that too–eventually. :P

lordsaturn

2011-02-21 14:56:26

http://help.github.com/

:)

BraK

2011-02-21 18:11:21

Nice tut timer i'll go ahead and stickify it.

~BraK

Train

2011-02-21 18:17:25

From: BraK
Nice tut timer i'll go ahead and stickify it.

~BraK


Thank you. :)

doublex8

2011-03-02 11:40:23

I downloaded the tortoise interface and I am not finding the gitclone option.

Echo_

2011-03-02 14:41:56

From: Train
@Nava2: Well, tbh, I wrote this off my personal experience with the program, I honestly have no idea where the official tutorial is.


http://help.github.com/win-set-up-git/

Found this a little easier to use than your method, idk why :p

Train

2011-03-02 14:43:49

From: doublex8
I downloaded the tortoise interface and I am not finding the gitclone option.


git clone, not gitclone.

doublex8

2011-03-03 00:00:35

From: Train
git clone, not gitclone.


lol either way it isn't showing up as that…at least it wasn't 9 hours ago…now it is. Before though the option was Git sync or some thing with sync in it.

Train

2011-03-03 00:25:43

From: doublex8
lol either way it isn't showing up as that…at least it wasn't 9 hours ago…now it is. Before though the option was Git sync or some thing with sync in it.


Go to the tortoise git tab, there should be a huge list–it'll be there.

doublex8

2011-03-03 13:05:44

From: Train
Go to the tortoise git tab, there should be a huge list–it'll be there.


Well like I said it finally showed up as Git clone instead of Git sync but when it was Git sync there was no option even in the tab. I got what I needed though so thanks :)

footballjds

2011-04-22 21:25:35

Thanks bro, just used this <3