22 Manage Your Visual Application With Git

Git is at the heart of application development in VB Studio, with application code stored in a Git repository and all your changes managed through branches.

When you first create a visual application, VB Studio can create a Git repository for you. You can choose between a scratch repository, or a repository with a default branch (for example, main) and an associated working branch. In most cases, the main branch is the source from which your artifacts (like a visual application) are built. Your project repository is called the remote repository, while the clone in your workspace is called the local repository. As you develop your application, your changes become available to other team members when you commit and push changes from the local branch in your workspace to the remote branch.

Within a workspace, the Designer connects you to the project's repository, enabling you to switch branches, push and pull sources, and merge changes—all through Git commands in the Designer. The Git commands that you'll use frequently to do your work show as follows:
  • In the header's Git menu (Label 1 in the image), which is a combination of your repository name and working branch, or Scratch Repository if you chose that option.
  • In the Navigator's Git Panel (Label 2 in the image), which shows the status of your workspace files (for example, whether they are changed, untracked, or in conflict). It also includes a menu (Label 3 in the image) that lets you access the same Git commands as in the header. You can also perform operations at the file level in the Git Panel.
Git Menu in the Workspace Designer

As you make changes in your workspace, you'll notice the Git Panel badged to indicate status. You can use this badge view—without actually accessing the Git Panel—to get a quick Git summary of your workspace. You'll see a count of the files that have changed in the workspace as well as a color indicator of the type of changes; green (Git Panel icon badged green) indicates new files, blue (Git Panel icon badged blue) indicates modified files, and red (Git Panel icon badged red) indicates files that conflict with changes made by other team members. When conflicts exist, the Git Panel provides tools to assist as you review and resolve issues.

A series of overlay icons also appear when you create, modify, or delete files. These overlay icons indicate the status of the artifact or file with regard to the branch that your workspace uses (uncommitted, conflict, or recently added). Here is a description of the icons that you'll see:

Status Icon Status Description
Up-to-date status icon The file has not been modified since it was last committed.
Status icon untracked A newly created file that has not been committed.
Status icon modified A file with modifications that have not been committed.
Status icon added A file that has been added, but the change is yet to be committed.
Status icon conflicting A file with conflicts that are not yet resolved. You'll usually see this status icon appear during Pull or Merge operations (or during a Cherry-Pick).
Status icon deleted A file that has been deleted, but the change is yet to be committed. You'll see this status icon only in the Git Panel.

The Git features in the Designer complement VB Studio’s support for source code management using Git, described in Manage Source Code Files Using Git Repositories. If you are new to Git, read the Git documentation at https://git-scm.com/book/ and http://git-scm.com/doc to learn more about Git repositories and Git basics, such as remote repositories, cloning, commits, pushes, SHA-1 checksum hashes, branches, and tags.