This blog post is intended to explain step-by-step how to publish Dynamics NAV Code on GitHub using the GitHub for Visual Studio plugin which you should install before continueing to read this post.
You should also have your own account on GitHub.
Create new Repository
Step one is to create a new repository. We’ll do that from Visual Studio using the plugin.
As you can see in the screenshot I am connected to my GitHub account.
Here I select Create and populate the window like this:
And this creates a new Repository on my GitHub Account
Adding NAV Objects to Git Repository
Next job is to add some NAV code.
For this project I want to have four folders since the workshop has four exercises. I want to develop the exercises indepentantly even though they are build on top of each other.
In this project I don’t care about standard Microsoft objects. I don’t want to make this more complex than it already is. I am not a big fan of building code repositories that start on CRONUS objects. I’d rather do deltas in that case. Let’s keep it simple and put the text files on GitHub that people have to import in their NAV2016 database.
I simply create four folders in my explorer where Visual Studio has put my project and put all the files there I want to be on GitHub. I have created a file per object using Soren Klemmensens vbs script, no need for PowerShell.
If I now go to my Changes windows in Visual Studio you can see it found 150 new files.
Smart tool! Now we select Add-All and put something in the Commit window and see what happens.
On GitHub, nothing happens. That is the funny thing about distributed version control. I can commit changes, and revert changes on my local machine without my co-workers see what I do.
I can see the commit hash and the infamous train tracks start to appear:
Sync to GitHub
All I have to do now, is to Sync to GitHub and my changes will be there, for everyone to download and change.
You can download them here: