Skip to content

bbraunj/oru-nasa-eap

Repository files navigation

How to Connect Simulink to this Git Repository

If on Windows, first get https://msysgit.github.io/. Default settings on the installer should be fine. Make sure you select Git BASH instead of Git GUI or Shell Integration.

Once you open up MATLAB, add this project from GitHub using the following menu: Screen Shot 2019-10-18 at 4 37 41 PM

Then, enter the following into the dialog: Screen Shot 2019-10-18 at 4 38 23 PM

When adding files and changes to Git, the current setup will require you to enter your GitHub username and password every time you want to push those changes to the internet. To avoid this, we will follow these steps:

Setting Up Your Computer to Automatically Authenticate with GitHub

  1. Open Git BASH. This was installed in the first step.
  2. Run the following command, replacing the email address with the one used for your GitHub account:
ssh-keygen -t rsa -m PEM -b 4096 -C "email_address@example.com"
  1. Enable the ssh-agent using the following commands:
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
  1. Next, print out your ssh key using the following command:
cat ~/.ssh/id_rsa.pub
  1. Copy the printed key to the clipboard, then head over to github.com. Navigate to Settings > SSH and GPG keys > New SSH Key and paste the key into the key box. The title can be whatever you want.
  2. You can verify that this worked using the following command:
ssh -T git@github.com
  1. Go to the directory where you created the Simulink project using the following command and your directory:
cd /path/to/the/oru-nasa-eap/directory
  1. Execute the following command:
git remote set-url origin git@github.com:bbraunj/oru-nasa-eap.git
  1. Check that the following command:
git remote -v

Produces the following output:

origin	git@github.com:bbraunj/oru-nasa-eap.git (fetch)
origin	git@github.com:bbraunj/oru-nasa-eap.git (push)
  1. If MATLAB is open, close it and open it back up for changes to take effect.

Now you should be able to push changes to the server without typing in your username and password every time.

Pushing Changes to GitHub

  1. Let's say you create a new Simulink model named Hello_World.slx from the Project tab in MATLAB as shown below:

Screen Shot 2019-10-18 at 5 01 13 PM

  1. You make some changes and feel ready to save those changes to the server. The first step is to make add any files that you created, as shown in the figure below.

Screen Shot 2019-10-18 at 5 06 58 PM

  1. Next, you commit these files. Committing in Git is like a savepoint that contains your files exactly as they are in this point of time. To do this, press the button shown in the following figure and enter a concise message of what changes/additions you made. This is very helpful for tracking what changes were made over time.

Screen Shot 2019-10-18 at 5 11 54 PM

  1. Once you click submit, these changes are saved in the local copy of the Git repository. Next, you need to push these to GitHub. This is simply done by clicking the button shown below:

Screen Shot 2019-10-18 at 5 14 36 PM

Your changes should now be on GitHub!

Getting Updates from the Server

If your local copy of the Git repository is behind the GitHub copy, you will want to pull those changes down to your computer. To do this, simply click the Screen Shot 2019-10-18 at 5 26 23 PM button in the source control menu.

Let's say you and someone else both have a certain copy of oru-nasa-eap on your computers. The other person makes changes to a file and pushes those to the server. If you make changes to the same file and try to pull changes from the server, you will encounter the following error message: Screen Shot 2019-10-18 at 5 31 09 PM

In this case, contact @bbraunj and he can help you figure this out.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages