Setting Up Git and WPI Suite - struct-by-lightning/wpi-suite GitHub Wiki

Installation

Ubuntu (or other Debian based) Linux:

Enter the following line into terminal:

$ sudo apt-get install git  

Windows:

Install Git with the installer located here.

You will then be able to run git through the included msysGit shell.

Mac:

Install Git with either of the two following methods:

Via MacPorts and terminal:

$ sudo port install git-core +svn +doc +bash_completion +gitweb

Or install with the installer located here.


##Setup For this project, we will be using a ###Configure User First we'll begin with configuring your local user info. Open terminal if on Ubuntu or Mac, or msysGit if on windows.

Enter the following into the terminal window:

$ git config --global user.name "Your Name Here"

This sets the name that will appear on your commits. Then enter the following to set the email tied to your commits. Use the same email you used for your github account here.

$ git config --global user.email "Your Email Here"

Set Up SSH Key

Next we'll set up an ssh key for your github account, so you don't have to log in every time you try to push or pull to the repository.

Follow the directions at the link for your platform below:
Linux
Windows
Mac

Forking the Team Repoitory

Now you need to fork the team repository to your own github account, an clone that repository to your computer.

First you need to login to your GitHub account in a web browser and navigate to the struct-by-lightning/wpi-suite repository located on your account. If it isn't located in your account, email the Release Engineer at [email protected] with your GitHub account name to get added as a collaborator. Everyone is being given collaborator access, because changes to the wiki cannot be submitted via pull request.

Then you need to hit the fork button in the top right corner, and select your account as the target. Once this is complete, head to your fork of the repository, where you will find a box on the right hand side of the page that looks something like this:

GitHub SSH clone URL

If it says something other than SSH in bold, click on the SSH link below the URL.

Now you need to clone your version of the repository to your computer. In terminal, navigate to the folder where you want the repository folder to be placed in, then enter the following into terminal, replacing [ssh address here] with the SSH URL from the repository page:

$ git clone [ssh address here]

This copies the repository on your account to the folder you were in, and sets up a remote called origin, that corresponds to the repository on your account.

Getting Updates From the Team Repository

Now you need to set up a remote for the team repository, so you can merge updates the team into your own repository. You do this with the remote add command. Enter the exact following code into terminal:

$ git remote add upstream git://github.com/struct-by-lightning/wpi-suite.git

Now you can get changes to the sbl-dev branch and merge them into your sbl-dev branch by entering the following:

$ git checkout sbl-dev
$ git fetch upstream
$ git merge upstream

However, be careful with the upstream remote. You should never push to it, only fetch. You should also only merge into your sbl-dev, and then if you need updated dev features in your feature branch, then you merge your sbl-dev into your own feature branch, which is covered in the next tutorial.

Next Task

Here are some resources to carry on from the end of this tutorial.
Using Git
Useful Git Commands
Project Structure