Working With AUH Repositories
Index
Introduction
Getting Started
Introduction ---------- Back to Top
This thread will explain how to set yourself up with access to the AUH git repository. Git is a distributed version control software, which essentially means a way for teams to collaborate revisions without having to rely on a centralized location such as a dedicated server. For us, that means being able to have multiple people changing and editing files at the same time without having to go through the process of everyone sending lump files to one person who manages a 'build'.
Getting Started ---------- Back to Top
I'm assuming that all of our developers are using a Windows operating system for development. If this is somehow not the case, you can PM me and I'll see if I can help set it up for Mac or Linux(though if you run Linux you really don't need my help).
Most of the setup instructions are verbose to pander to the least technical among us. If you feel like tl;dr, come back to it in multiple sessions because the setup only needs to be followed through with once if you do it right. And don't hesitate to ask questions if you get stuck rather than giving up, as none of this is too technical.
Step 1. Download and Install msysGit and Notepad++
Downloading and installing msysGit
Windows users should look to download a pre-compiled binary to make the process simpler. The most common and simplest package is msysGit, which is maintained on Google Code and contains all of the dependency packages needed to run Git. It is highly recommended you use this method, since this is the method the guide is written for.
Download: msysGit
You want the top package generally, the one which says "Full installer for official Git (version number)". At the time of writing this that's Git-1.7.0.2-preview20100309.exe , but it will change constantly, so get whatever the latest version is.
Once you've downloaded the installer, click it and follow the instructions. Follow these guidelines when making selections during the installation process:
Install to an easy location like C:\Program Files\Git or whatever the Vista/7 equivalent is. When selecting components, follow the image below for best results. The Windows Explorer context menu integration is optional, but do not select git-cheetah because it is a pain to uninstall and may conflict with other methods covered later.
Image
On the prompt 'Adjusting your PATH environment ' use the default option unless you know what you're doing.
Image
On the prompt 'Choosing the SSH executable ' select 'Use OpenSSH '. You may not have both options if it doesn't detect PuTTY.
Image
On the prompt 'Configuring the line ending conversions ' select 'Checkout as-is, commit as-is '. This is very important. Git expects Linux systems and programming code projects, and Linux uses a different line ending. Since AUH is being developed on Windows and all files will inherently start out with Windows line endings, we don't want to accidentally convert them to Linux and then have someone check them out as non-Windows line endings. We may need to change this if for some reason someone is developing on a non-Windows platform, but it can be done later in config files.
Image
Continue with the installer as necessary and wait for it to complete. You should now have a complete installation of Git.
Downloading and installing Notepad++
Notepad++ is an advanced text editor with text wrapping, syntax highlighting, tabbed document editing, and autocomplete, just to name a few of its features. It is also pleasant to look at, unlike many of its utility first counterparts such as Vim. If you already have it installed, you can skip this step. If not, carry on -- it doesn't matter if you intend to do text editing, coding, or scripting for AUH, you should get this editor regardless -- and download the installer from the link below.
Download: Notepad++
The file you want is npp.x.x.x.installer.exe where the x's are the version number. The installer is pretty straightforward, the only thing you should do is check the option which states 'Don't use %APPDATA% ' on the 'Choose Components ' dialog. There's a plugin written for M2 syntax highlighting which needs this option checked, but that will be covered elsewhere.
You should now have a complete installation of Notepad++.
Spoiler Alert, click show to read:
Step 2. Download and Install Git GUIs
With the above installation, you could interface with the AUH Git repository and do all the work, but you would need to work from a command line. I'm going to assume no one wants to work from a command line, and that you'd much rather utilize a Graphical User Interface (GUI) to make it all simpler to use and look at. If you do want to use a command line to do everything, I'll leave you to your machinations, because you probably don't need this guide if you're that adventurous.
This guide utilizes two Git GUIs, and is optimized for Windows. Why two? One of the two is simpler in its approach and setup for working with it in general. The other is more integrated and can be worked with through Windows Explorer, and also provides some nice icon integration which is useful regardless of whether the tool is used.
Downloading and installing SmartGit
SmartGit is a centralized tool that works as a program to perform common Git operations. It is simpler to understand for users not used to working with command lines or in directories, which is why it will be used to perform most examples later on.
Download: SmartGit
Clicking the 'Download' button on the above page will give you a license agreement prompt; agree to it and it will download an archive of the latest SmartGit version. Use a program like WinRAR, WinZIP, or 7-Zip to unpack the archive, and then run the EXE file contained within(at the time of writing it's called setup-1_0_4-jre.exe , but it will change with each new version).
The installer won't ask you many questions, so just keep hitting next and change things like install directory if you want. After you install it, run the desktop shortcut it created, and it will have you configure it. Use these guidelines for configuration:
Select option 'Non-commercial use only', as we're using this for non-commercial purposes. Select 'Use SmartGit as SSH Client' Enter User Name and E-Mail. For me this is "Augustus Lucifer" and "CWardUSC@gmail.com". These are used by Git to track who made commits(changes). Please use your TWC name and a valid e-mail.
After that's done, it will open a 'Welcome to SmartGit' prompt which asks what you want to do. Right now you want to close the prompt and exit SmartGit, because we haven't finished setup so it's not time to work with a repository yet. SmartGit will persist in the system tray after you close it, so you need to exit it from there or kill the process in task manager to fully close it.
You should now have a complete installation of SmartGit.
Downloading and installing TortoiseGit
TortoiseGit is a tool that integrates with Windows Explorer, allowing you to perform tasks in Git while directly accessing folders and files. This may be a simpler method for some, but the main reason we want it is for a few specific tasks and the fact that it includes icon integration, which will be explained more later.
Download: TortoiseGit
You want to select the package which is newest. It comes in 32-bit and 64-bit versions, so select the one which matches your operating system type. At the time of writing, the file you want is TortoiseGit-1.3.6.0-xbit.msi , where x is the bit of your operating system.
Once you've downloaded the installer, click it and follow the instructions. When installing, use the default options and you should be fine. Make sure if it asks for your Git install directory you point it to the right location, but it should find it in the registry. You will need to restart your computer when it finishes installing, in order to have some of its features take effect. After restart, when you right-click on a file or folder, you'll notice there's a new option called 'TortoiseGit' and sometimes a couple others in that section; if this is not the case, something went wrong in installation.
You should now have a complete installation of TortoiseGit.
Step 3. Request Account, Generate SSH Key, and Associate SSH Public Key
AUH Repository
This part is pretty self-explanatory. Some of you may have been sent a PM which contains an account in the AUH Repository space. If not, you need to send me a PM and request that I create an account for you. Either way you will want to bookmark the prior link because you'll be using it to log in and use Trac, though you won't need it to interface with the repository after setup.
Once you have an account name and password, verify that you can login with it at the above link. You'll come back to this later, for now continue to the next part.
If you already have an SSH Key pair, you can skip this step.
Git connects over a protocol called SSH . You probably connect with the HTTP protocol all the time, but you don't need to know anything about protocols and their properties to work with Git, just know that the operation helps secure the connection so that even if someone somehow got into your account they would not be able to connect to the repository because they don't have your private key. An 'SSH Key Pair' consists of a private key and a public key. The private key is stored on your computer in a ~/.ssh/ directory(~ is home directory, for me on Windows it's C:/Documents and Settings/Christopher/), and the public key is stored there and also provided to the server. This doesn't need to make sense!
To generate an SSH Key, we will use msysGit, so you need to have that installed as per Step 1. The installation should have created a shortcut on your desktop called "Git Bash". If not, there should be a shortcut of the same name in the installation directory. Either way, click it and it should open a command menu that looks kind of like this:
Image
I know I know, not the prettiest interface ever created, but it isn't supposed to be. The text in green will be different for you. To change to your home directory, type cd ~ into the window and press <Enter>. Next you will type the command to generate an ssh key which takes the following format(second command in image):
Image
Substitute the e-mail for your e-mail and type that in, then hit <Enter>. If you did it right, some text prompts should follow like this:
Image
This text is asking if you want to name your key. I don't recommend naming your key unless you have other keys to differentiate from, in which case why are you following this tutorial? Just hit <Enter> and it will use the default name for the key. Then it will prompt you for a passphrase:
Image
The passphrase is important, because when connecting over SSH with a key pair, either through a GUI or at the command line, you'll be prompted to put in your passphrase. Use a secure passphrase; don't leave it empty under any circumstances, something is better than nothing. It's just another word for password, it doesn't want something like "The Man From Nantucket", not that kind of phrase. Type your passphrase and note that it will not show you text as you type; it's accepting the input though so type the entire thing and hit <Enter>. It will then prompt you to re-enter it to ensure you know it, so re-enter it and hit <Enter> again. You should then get text like this stating that your key has been generated:
Image
The specifics of what it says don't matter. You can close the window for now and proceed to the next section. If for some reason you didn't generate a key, go back through the steps and ask any questions you may have in this thread.
At this point you should have an account at the AUH Repository and you should have generated an SSH key pair(you don't have to know what or where they are right now). First things first, go to the link above and enter your username/password to login. Once you're logged in, at the top right should be a link labeled "Preferences"; click it. From the preferences page on your account there's three options in the navbar: General, Notifications, and Public Keys. Go to Public Keys and it should look like the image below, except you won't have an id_rsa entry yet:
Image
From here click the "Add Key" link and some input boxes for 'Name' and 'Value' should open up. 'Name' should be the same as the name you selected for the key pair, by default it's 'id_rsa'. 'Value' is the value of your public key, which we'll now go and get. Navigate to your home(user) directory, for me this is 'C:/Documents and Settings/Christopher/'. This is the folder that should contain My Documents and such, though in Win7/Vista it will be slightly different. Inside this folder should be a folder labeled .ssh , navigate into there. You should now see at least two files in there, which if you kept the default names will be id_rsa and id_rsa.pub :
Image
If you don't have the folder you didn't generate them correctly or are in the wrong location; same if you have the folder but not two files like that(you don't need a known_hosts file). Now what you want to do is open the public(.pub) file in a text editor such as Notepad or Notepad++, just right-click Open and select one of them, it's a plain text file even though it doesn't end with txt. When I open mine with notepad it looks like this:
Image
Yours should look similar, with the e-mail at the end yours and a bunch of letters and numbers preceding. Highlight it and copy(ctrl+c), then go back to the window where you have your preferences open and paste(ctrl+v) it into the 'Value' field. Once you have a name and a value entered, click 'Add Key'.
Voila! You're now setup to access the AUH Repository. I can toggle whether you are allowed None, Read Only, or Commit privileges on a given repository and this may not be set quite yet, but you're all set in terms of basic setup. The next section will discuss how to get a local copy of the AUH repository set up and then cover some basic commands in a test area.