Setting up LabVIEW for Git

01110000011100100110111101100111011100100110000101101101
Locked
User avatar
Tanner
Alumni
Posts: 1351
Joined: May 27th, 2009, 5:26 pm
Team Position: Alumni
Location: Suwanee, GA
Contact:

Setting up LabVIEW for Git

Post by Tanner »

This tutorial/post will hopefully get you set up using Git with LabVIEW.

  1. Install Git for Windows.
  2. Install TortoiseGit.
  3. Reboot.
  4. Follow the instructions in this tutorial: Using LVmerge LabVIEW Merge Tool with TortoiseSVN
  5. [placeholder for installing/configuring LVDiff]
  6. 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.

    Code: Select all

    #Ignore personal settings
    *.lvlps
  • Commit this file.

Hopefully you should have a fully functional VCS for LabVIEW. Yay!

-Tanner
Words of the Year: Tautology, Hysteresis, Buxom, Purvey
"Crossing into established events is strictly forbidden. Except for cheap tricks." - Doctor Who
"Excuse me, I'm making perfect sense you're just not keeping up." - Doctor Who
User avatar
Tanner
Alumni
Posts: 1351
Joined: May 27th, 2009, 5:26 pm
Team Position: Alumni
Location: Suwanee, GA
Contact:

Re: Setting up LabVIEW for Git

Post by Tanner »

Setting up your computer for use with GitHub (not necessary for the season, but useful for now).

  1. Open the Git Bash by going to Start -> Program Files -> Git -> Git Bash.
  2. Enter "ssh-keygen" (without quotes).
  3. Accept the defaults arguments.
  4. Note the location of "id_rsa.pub".
  5. Open "id_rsa.pub" in a good text editor (like NotePad++, but Notepad works).
  6. Set-up your GitHub account to use the public key.
    1. Open your GitHub Account Settings in your browser.
    2. Click "SSH Public Keys"
    3. Click "Add another key"
    4. Give your key a name (ex: "my home computer") and copy the contents of id_rsa.pub to the textarea.
    5. Click "Add key"
  7. Convert your key for use in TortoiseGit.
    1. Download PuTTYGen (or the whole package if you care).
    2. Start PuTTYGen.
    3. Click "Load".
    4. Navigate to the folder where you saved "id_rsa.pub".
    5. Open the file "id_rsa" that Windows recognizes as type "File" (aka - no file extension at all).
    6. PuTTYGen should say it imported a foreign key and that you should save it.
    7. Click "Save public key" and save it as "putty_pub" in the same folder as the other keys.
    8. 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).
    9. Close PuTTYGen.
  8. Configure TortoiseGit to use your key.
    1. Right click on any file in Windows Explorer that is inside your project.
    2. Click on "TortoiseGit -> Settings".
    3. Navigate to "Git -> Remote".
    4. Click "Add New".
    5. Change "Url" to be the GitHub URL. Should look something like "git@github.com:Username/...."
    6. For "Putty Key" navigate to the location where you saved "putty_priv.ppl"
    7. Click "Apply".

I think that is it. If you want to grab code from GitHub, you'll have to do this.
  1. Right click in white space in Windows Explorer.
  2. Select "Git clone".
  3. 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.
  4. Check "Load Putty Key" and navigate to the location of putty_priv.ppl"
  5. Click "Ok"
  6. 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:
  1. Right click on a file in your repository.
  2. Click "TortoiseGit -> Push".
  3. 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.
  4. 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
Words of the Year: Tautology, Hysteresis, Buxom, Purvey
"Crossing into established events is strictly forbidden. Except for cheap tricks." - Doctor Who
"Excuse me, I'm making perfect sense you're just not keeping up." - Doctor Who
Locked

Who is online

Users browsing this forum: No registered users and 1 guest