Setting Up a Riaforge Project with Git and Github (Part 2)
Published on
This is a series over using Riaforge with Git and GitHub. So far we installed some software, next we will register for a free GitHub, create a repository, and clone it.
Registering will only take a couple seconds. Go to the signup page.
Fill out the information but skip the SSH Public Key field. After submitting the registration form, you will be presented the dashboard screen. Select "Create a Repository" and fill out this page. Put in your RiaForge project name in the "Project Name" field, add a little description in that field (be sure to put mention ColdFusion), in the "Homepage URL" field copy your RiaForge url, and hit the "Create Repository" button.
Next page will have some information we can skip for now. Click on the link below "Importing a Subversion Repo?". Paste in your SVN Repository URL where is says "SVN Repository URL". Click "Import SVN Authors". GitHub will read your SVN repository and display any authors it finds.
READ CAREFULLY HERE. Either fill out all the authors as shown or NONE. Also when you submit this form, the import process may take only minutes up to 5 days depending on the size of your repository. You will recieve and email from GitHub when the process is finished.
After submitting you will be taken back to the master page of your new GitHub repository for this project.
Configuring Local System
Let's configure our local system now and create a SSH public key. This will be used to authenticate you when doing push and pull commands to git. Open up the command prompt and run these commands. Replace your information with mine.
Click return/yes on any popups.
git config --global user.name "mhenke"
git config --global user.email "henke.mike@gmail.com"
ssh-keygen -t rsa
git config --global core.autocrlf true
ssh-keygen
Let's test the authentication. Go back to your command prompt and type in this command.
ssh git@github.com
Workaround
Next is step is kinda a work around for something TortoiseGit installed and will be used to for our private clone.
Open up, PuttyGen. It should be under the Start menu, TortoiseGit. Next load our private key we created. File --> "Load private key" and then naviagate to our id_rsa file. You will have to select "All Files (*.*)" so you can see our private key and press Open.
A dialog box will open and press ok. Next select, File --> "Save private key". Click "Yes" and put in "id_rsa.ppk" and then save. This is for our workaround.
Next we will copy the key shown in PuttyGen and paste it into GitHub. If you are still logged into GitHub, there should be an "account" link toward the right top of the page. Select that and then scroll down. Under "SSH Public Keys" select "add another public key", put in the title "rsa_id", paste in the copied key from PuttyGen and save it.
One last thing while here on the GitHub Account page, scroll back toward the top and you should see a "Your User Information" panel. Select the "Global Git Config" link. GitHub is user friendly and will prove snippets for you to copy, paste, and run. Copy the second line and run it in your command prompt.
git config --global github.token xxxxxxxxGITHUBTOKENxxxxxxxxxxx
Cloning
Let's wrap up the long entry by running cloning our git repository. Navigate on GitHub to the repository home page. Click on the link next to "Your Clone URL". Copy this snippet to your command prompt and run it.
This is the work around error, I mentioned. Create a text file and paste in this.
start "start pageant" /B "C:\Program Files\TortoiseGit\bin\pageant.exe" "C:/Users/Owner/.ssh/id_rsa.ppk"
exit
And save it as github.bat. Create a shortcut and put it in your startup or if you want just run the batch when you are using GitHub. Run the batch file now and you should see an new icon your Notification area.
Now rerun our clone command in our dos prompt.
Conclusion
Well, now you have a working copy of our GitHub repos. We covered alot and my next post will explain more in depth what we did, along with how to work with our new clone. I recommend watching the "Insider Guide to GitHub" screencast and "Setup, Initialization and Cloning" episode from GitCast.
For more on what we did read these links.
Setting user name, email and GitHub token
Guides: Providing your SSH Key
Guides: Dealing with newlines in git