[go: nahoru, domu]

Skip to content

F-Kg/git_for_br_automation_studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

Introduction

This guide will take you through the first steps in using Git as a version control system for a B&R Automation Studio (AS) project.

Prerequisites

  1. Download and install the most recent version of Automation Studio from the B&R homepage
  2. Download and install the most recent version of Git from the Git homepage

In this guide, we use Git BASH to use Git from the command line. If you prefer a GUI, the Git homepage has an overview.

Configure your name and email

If you haven't already entered your name and email in the Git configuration, you must do this now.

Open git bash and enter:

git config --global user.name '<my_name>'
git config --global user.email '<my_email@my_domain.com>'

Git config

Create a new AS project

Create an Automation Studio project as you are used to.

New AS project

Add a .gitignore file

In your project directory, add a new file and name it ".gitignore".

touch .gitignore

gitignore

This file specifies files that you do not want to put under version control, such as binary files and automatically generated files.

Open .gitignore in a text editor and enter:

/Binaries
/Diagnosis
/Temp
/*.set
/*.isopen

Initialize a Git repository

Open git bash in your project directory and enter:

git init

This creates a Git repository inside your project directory.

git init

Stage your changes

Open git bash in your project directory and enter:

git add .

This stages all files (except the ones in .gitignore) for your next commit.

git add

Commit

Open git bash in your project directory and enter:

git commit -m 'initial commit'

git commit

Conclusion

Congratulations! Your project is now under version control with Git.

But this is just the beginning, there is much more to Git! You will probably want to use a remote repository on your server or on a hosted platform like GitHub, so that you have a backup of your data and so that you can work in teams.

In this tutorial, we decided to only show you the very first steps. With the exception of the .gitignore settings, everything in this tutorial is standard Git and not B&R-specific. There are a lot of great ressources out there that cover Git in great depth, here is a small selection:

Releases

No releases published

Packages

No packages published