Git
What is Git?
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Coursea Version Control with git
How is it used?
I have Git up and running within my team. Git is a way to chronologically save stuff over time, so you don’t lose work which hasn’t been saved as a new copy of the old program. A repository is supposed to be an easy to maneuver location where code (Ladder logic) and artifacts (E.G: HMI files) are stored.
The following is a small tutorial on how to use git, as well as an advanced in depth way of working with Rockwell tools and Git at the same time. You can make a personal repo just for yourself, or a combined repo for yourself as well as your teammates in a shared location. Both add value to my workflow personally.
We have the following code storage structure in our team:
-> Remote directory on a shared drive
-> Local directory per team-member
What do I need?
Git Extensions GUI which simplifies GIT for users.
Sourcetree Atlassian GUI for git
RSLogix 5000 or Studio 5000 Logix Designer
How do I configure it?
OK, so here is what I did on the config side:
Install Git on your machine.
Install Git Extenstions on your machine.
If you want the capability of comparing, make sure you have Logix Designer Compare Tool installed on your machine as well.
Make an empty directory in a local location (i.e. somewhere on your computer), then right click in windows explorer, and click
Create GitExt new repository...
then selectPersonal Rep
thenCreate
.Once you have this empty repository, right click in windows explorer, and then GitExt Open repository.
In GitExt, click
Repository
on the menu bar thenEdit .gitignore
.In the Edit .gitignore pop-up window paste the following:
#Ignore useless packages created by RSLogix.
.bakacd
*.acd.recovery
*.sem
*.wrk
This will stop the temporary files from being included in the git and will declutter your system.Hit save.
Now go to
Tools
>Settings
>Git
>Config
. Enter your username and email. Hit save.Install Logix Designer Compare Tool
Open the Setting dialog box in Git Extensions by clicking
Tools
>Settings
in the menu bar.In the navigation pane select
Git
thenConfig
.In the Config window:
• You’ll find an option to fill in your username, email, etc.
• In MergeTool: Type in a name for the Merge Tool, something like RSLogixMerge.
• The default Path to Mergetool isC:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe
• The Mergetool command is"C:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe" -m "$LOCAL" "$REMOTE" -PM FastestCompare
• In Difftool type in something like RSLogixDiff, which defines a new difftool in git.
• My path to difftool was:C:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe
• My difftool command was:"C:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe" "$LOCAL" "$REMOTE" -PM FastestCompare
• Line endings: Not Set.Hit apply, and you are set! Now, if you commit an ACD file, make a change, save it, and then commit another file.
Where are the remote repositories?
The remote repositories are on bitbucket.org.
Global Interlock System git
Logic Files: http://bitbucket.org/dkist/gis.git
HMI Files: http://bitbucket.org/dkist/TIM.git
Repositories:
https://bitbucket.org/DKIST/gis.git
https://bitbucket.org/DKIST/emcs.git
https://bitbucket.org/DKIST/instruments.git
https://bitbucket.org/dkist/m1_c-c.git
https://bitbucket.org/dkist/fms.git
https://bitbucket.org/dkist/tim.git
https://bitbucket.org/DKIST/S120.git
https://bitbucket.org/DKIST/ATST_SOS_ACS_Mount.git
Other Useful tools
Slack has Bitbucket app that will let you subscribe to various messages when the repositories are updated. Integrate Bitbucket Cloud with Slack