Reference Design Content

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Started: Git and GitHub setup

 

Getting Started with Git

 

1. Install Git from http://www.git-scm.com. These instructions may come in handy: https://help.github.com/articles/set-up-git

 

Once you've installed git, get acquainted with some of the concepts through this series of guides from Atlassian:

 

Excellent Atlassian Guide

 

Other suggested guides:

The Basics: http://rogerdudler.github.io/git-guide/

Visual Guide: http://marklodato.github.io/visual-git-guide/index-en.html

Full guide: http://git-scm.com/book

A git workflow model: http://nvie.com/posts/a-successful-git-branching-model/

 

Getting Started with GitHub

 

2. Create a GitHub account at http://www.github.com

 

Follow these steps to configure an SSH key for your account. While not required, this makes commits easier.

 

Optional: Using a Git GUI

 

A number of GUIs exist for Git which take away some of the guesswork involved in running from the command line. Git actually installs with one. On windows, it can be found in the start menu ("Git Gui"). You may also see it called gitk on the web. However, this gui is very minimal. Developers would benefit from installing an additional GUI.

 

If developing in text-based languages, Visual Studio Express 2013 provides direct integration with Git through an embedded version of the tool (ie it does not require the separate command line download).

 

3. Install SourceTree (Recommended)

 

If developing in LabVIEW, a separate tool is currently required. In the past, TortoiseGit and GitExtensions were recommended for LabVIEW development. At time of writing, the best tool seems to be SourceTree, which has a very modern visual interface as well as integration with Git and Mercurial as well as GitHub, Bitbucket, and Stash.

 

If using SourceTree, you'll want to set up the SSL key authentication features.

 

Recently, a user on LAVA posted a new project integration tool for git. It may suit your needs:

 

http://lavag.org/topic/18332-labview-tortoise-git-integration-lv-tortoisegit-v0811/

 

Optional: Set Up Diff and Merge

 

The LabVIEW diff and merge tools included in the professional version are described in the following help topics:

 

https://www.ni.com/docs/en-US/bundle/labview/page/configuring-source-control-with-lvcompareexe.html

https://www.ni.com/docs/en-US/bundle/labview/page/configuring-source-control-with-lvmergeexe.html

 

Git is a very Linux-centric tool and it provides all diff and merge paths in linux notation (that is, /c/file/path/here). It also assumes that most will be done using the command line interface, so everything is provided as a relative path to the working directory (pwd). This causes a number of issues, which are exacerbated by the merge tool's reliance on GUI interactions. If a merge was unsuccessful, there is no way for git to know if it was successful, so it assumes that by running the LabVIEW merge tool you must have merged correctly.

 

For a number of years, this set of scripts has assisted LabVIEW developers in handling these issues. Install instructions are available on the website. In an attempt to make these same scripts work for the command line, SourceTree git, and SourceTree mercurial, this branch was created. This development was partially successful, but not as complete as the original scripts. To solve the problem, a small labview tool was developed for performing the diff and merge. This is located here, along with instructions for how to build and install it:

 

https://github.com/dsmithni/vicompare

Comments
vix
Active Participant
Active Participant
on

I tried LabViewGitEnv scripts but they don't work on my PC (Win7 SP1 64 bit with several versions of LabVIEW installed).

I don't know if vicompare tools works or not because LabViewGitEnv created a mess on my git configuration for .vi and .ctl files and it took two days to fix this.

So I'm not so confident in giving a chance to another tool which is 2 years old.

This user group suggests a different approach and I think it's time NI takes in charge the git-integration topic and supplies an official out-of-the-box working solution.

If anyone is interested, I was able to configure TortoiseGit as described here.

I don't know if the git command line or other git clients (SourceTree, GitExtensions, ...) work or not.

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
Dan_Alias
Member
Member
on

I think the LabViewGitEnv scripts require GitBash to be installed and in the path.

RVallieu
Active Participant
Active Participant
on

I wish this content wasn't as buried as it is.  I had to get here through searching fro Sourcetree, and then reading clicking through a link that didn't look all that promising, then find the reference in the page launched after hitting <Learn More>.

 

1st Search result that I found was this link under the Center of Excellence

https://learn.ni.com/center-of-excellence/resources/849/document-intro-to-git-github-sourcetree

 

Maybe you (NI) realize this since this is the document referenced in the link?  

 

The provided code for VICompare in the Github repo worked great at any rate.  I appreciate it.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center