This script makes it easy to manage your PSoC Creator project with Git using Windows PowerShell. A .gitignore file is provided that works whether or not you decide to use this script.
Tested with PSoC Creator 4.2 on Windows 10
- Install Git
- Make sure Git is set up with your PATH
- Create a new repository
- In the PSoC Creator project directory:
git init
git remote add ...
- Make sure you are logged in to GitHub (or GitLab, BitBucket, etc.)
- Copy the .gitignore and .ps1 file to your project directory. Review them and make any changes. A helpful, but somewhat out-of-date, guide from Cypress about version control can be found here
Open PowerShell and invoke the .ps1 script, or right-click it and select "Run with PowerShell." Note that you may get a script execution warning, just press Y
You will see all the files that were added, and then you will be prompted for a commit message. Hopefully, the changes will commit and push to the repo
I have to make exceptions for Generated_Source since it can contain custom code sections that aren't overwritten when compiling:
Revision Control for PSoC® Creator™ Projects - KBA86358
GitHub and PSoC Creator Projects
Also what about .gitattributes for telling it which files are plain text vs binary, and handing line endings, etc.?
Also I ignored things like datasheet pdfs or cywrk files, but later realized they are necessary if you want to clone a repo to another computer, etc.