Back to: YANGsters
YANG Catalog: A set of tools to aid in the development of YANG
pyang: YANG validator, transformator and code generator, written in python. It can be used to validate YANG modules for correctness, to transform YANG modules into other formats, and to generate code from the modules.
Some install help can be found here –> Cygwin
Some useful tools
Cygwin Unix-like environment for windows. Look at the pyang install guide linked above to see what packages need to be added
Git Revision Control
GitHub Online Repository that uses Git
Notepad++ A programmers editor. Useful for looking at source code and there are many plugins for syntax coding
Example of running Git: (FYI)
I have a clone of my fork of the YangModels/yang repository on my PC running Cygwin.
To fork and clone:
Get a GitHub account. Mine is https://github.com/samans (this information will be used in the example below).
Go to the YangModels/yang repository: https://github.com/YangModels/yang
Click the Fork button and pick your repository as the target.
Click on the Clone or download button.
Click on the button that is circled to copy the path to your clipboard.
Go to Cygwin to a folder where you want the clone to be.
Run “git clone <<your repository>>
Syncing with master:
If it has been a while since you cloned, it is very possible that your repository and your local clone on your PC are out of sync with the yang master. If you use the yang repository like I do, I only sync when I want to upload something new. I don’t do development or other work in my clone on my PC. So I want my copy of the repository to be a duplicate of the YangModels/yang master branch.
If this is the first time, you will need to make sure your upstream repository is set correctly.
Do a: “git remote add upstream https://github.com/YangModels/yang”
You can check by running git remote -v
My origin is set to my fork and the upstream is set to the YangModels/yang repository.
I need to sync, I can tell by looking at my repository in github:
Fetch Upstream: The brings down the changes from the YangModels/Yang master branch.
git fetch upstream
Check out the master branch of your local repository
git checkout master
Merge the changes from upstream master to your local master
git merge upstream/master
That command has the potential to produce a lot of output.
Now push changes to your remote repository.
git push origin master
Now check github…
Now ready to do whatever updates you need.
Do a checkout and identify a branch
git checkout -b newThing
If you add files you need to do a git add
Do a git commit
Push to my fork
Then submit the pull request to YangModels/yang on github