The NAV Developer Preview Azure Image will install Git automatically. In case it is necessary to install Git manually, it is possible to download the installation files here. I have compiled general information about branches and how to utilize it here.
How to create a new branch
Create a new project using the command “AL: Go!” and a repository as described here.
After that, type “git create branch” in Command Palette and press Enter.
VSCode will prompt for a name for the new branch.
VSCode does show the current selected branch in the lower left of the Status Bar.
Now, let’s create a code change and merge it into the new branch.
The code change will be transferred to Source Control by saving the file. Git will notify automatically that the saved file differs from the file stored in the branch and highlight it with a “M” for “modified”.
Now it is necessary to merge the latest changes into the version stored in the branch. I personally prefer the keyboard, so I type “git open changes” in the Command Palette. VSCode will show now the old version in the left window and the new version in the right window.
It is possible to stage (or merge) a line individually or all together by executing the command “git stage all changes” using the Command Palette. The changes are now marked as “Staged changes” and it is possible to commit the changes to the branch using the command “git commit staged”. VSCode will prompt for a description which should be meaningful.
Using the command “git checkout to…” it is possible to switch between branches of a repository.
Done!
You must be logged in to post a comment.