Publish Dynamics NAV code to GitHub

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.

GitHub1

Here I select Create and populate the window like this:

GitHub2

And this creates a new Repository on my GitHub Account

GitHub3

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.

GitHub4I 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.

Commit Changes

If I now go to my Changes windows in Visual Studio you can see it found 150 new files.

GitHub5

Smart tool! Now we select Add-All and put something in the Commit window and see what happens.

GitHub6

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:

GitHub7

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.

https://github.com/markbrummel/Master-Class-Examples/tree/master/Exercise%201

GitHub8

You can download them here:

https://github.com/markbrummel/Master-Class-Examples

 

1 Comment

  1. dgroenkjaer says:

    Don’t know if you found it yourself, but in case anyone else would be looking for the vbs script it can be found here:

    Like

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.