Page 1 of 1
Setting up LabVIEW for Git
Posted: January 21st, 2010, 9:15 pm
by Tanner
This tutorial/post will hopefully get you set up using Git with LabVIEW.
- Install Git for Windows.
- Install TortoiseGit.
- Reboot.
- Follow the instructions in this tutorial: Using LVmerge LabVIEW Merge Tool with TortoiseSVN
- [placeholder for installing/configuring LVDiff]
- Relax.
Now, for any project with LabVIEW you need to:
- Create a file called ".gitignore" (without quotes) in your new git repository/LabVIEW project.
- Place the following in the file and save.
- Commit this file.
Hopefully you should have a fully functional VCS for LabVIEW. Yay!
-Tanner
Re: Setting up LabVIEW for Git
Posted: January 21st, 2010, 9:38 pm
by Tanner
Setting up your computer for use with GitHub (not necessary for the season, but useful for now).
- Open the Git Bash by going to Start -> Program Files -> Git -> Git Bash.
- Enter "ssh-keygen" (without quotes).
- Accept the defaults arguments.
- Note the location of "id_rsa.pub".
- Open "id_rsa.pub" in a good text editor (like NotePad++, but Notepad works).
- Set-up your GitHub account to use the public key.
- Open your GitHub Account Settings in your browser.
- Click "SSH Public Keys"
- Click "Add another key"
- Give your key a name (ex: "my home computer") and copy the contents of id_rsa.pub to the textarea.
- Click "Add key"
- Convert your key for use in TortoiseGit.
- Download PuTTYGen (or the whole package if you care).
- Start PuTTYGen.
- Click "Load".
- Navigate to the folder where you saved "id_rsa.pub".
- Open the file "id_rsa" that Windows recognizes as type "File" (aka - no file extension at all).
- PuTTYGen should say it imported a foreign key and that you should save it.
- Click "Save public key" and save it as "putty_pub" in the same folder as the other keys.
- Click "Save private key" and save it as "putty_priv" in the same folder as the other keys (not sure if this is important, but might as well just in case).
- Close PuTTYGen.
- Configure TortoiseGit to use your key.
- Right click on any file in Windows Explorer that is inside your project.
- Click on "TortoiseGit -> Settings".
- Navigate to "Git -> Remote".
- Click "Add New".
- Change "Url" to be the GitHub URL. Should look something like "git@github.com:Username/...."
- For "Putty Key" navigate to the location where you saved "putty_priv.ppl"
- Click "Apply".
I think that is it. If you want to grab code from GitHub, you'll have to do this.
- Right click in white space in Windows Explorer.
- Select "Git clone".
- Enter the URL of the GitHub repository for "Url". (i.e. - git://github.com/Tanner/Team-1261---LabVIEW.git)
- Note: This is the public (i.e. read-only) URL for the GitHub repository Team 1261 - LabVIEW. I can't get it to work, but the private url does in fact work.
- Check "Load Putty Key" and navigate to the location of putty_priv.ppl"
- Click "Ok"
- A window should pop-up with a turtle doing backflips. Life is good.
I think that is it...
Oh yeah - to push all your commits to GitHub, do this:
- Right click on a file in your repository.
- Click "TortoiseGit -> Push".
- Window should pop up saying the local branch is "master" and the destination remote is "origin". If it is not like this, you missed cloning the GitHub repository.
- Click "Ok" and watch the turtle dance.
Same thing for pulling down updates. Not sure what the difference is between "fetch" and "pull". I think pull it better. Maybe.
-Tanner