Introduction

The real power of GitLens comes in when you have a project with multiple commits, branches, and contributors. You'll be able to efficiently track changes, understand code history, and get insights into your project's evolution.

Consult the GitLens documentation to configure VSCode properly and discover more functions.

Installation

If you haven't already, download and install Visual Studio Code and add the official Julia extension by typing "Julia" in Extensions. You are now ready to install GitLens: type "GitLens" in Extensions and install it.

install_gitlens.png

Interacting with Git systems

On the left-side panel, you'll notice a new section added by GitLens, which provides different views like Repositories, File History, Line History, etc. Click around to see various details about your Git repository and its history.

If you already have existing repositories, you can inspect them by expanding 'Repositories':

view.png

If you don't have existing repositories or want to create a new Julia project, follow the steps below to set it up:

  1. Create a new folder for your Julia project

  2. Launch VSCode, and open the folder you created by clicking on File > Open Folder.

  3. Initialize a Git repository by opening the terminal in VSCode (View > Terminal) and typing:

    git init
  4. Create a new Julia file and populate it with some content.

  5. Commit your changes by opening the terminal and typing:

    git add .
    git commit -m "Initial commit"

Provided there were no Git-related errors, you should be able to see the commit in the following panel:

commits.png

While GitLens supercharges your Git experience in VSCode, remember that standard Git operations like commit, push, pull, etc., can be performed through the standard VSCode source control interface or through the terminal.

Useful GitLens features

GitLens offers a plethora of other features, such as:

  • Viewing who changed a line and when.
  • Exploring the history of a file or line.
  • Viewing a Git blame annotation.

To explore these features, you can:

  • Hover over the line numbers in your code. GitLens will display who modified the line and when.
  • Click on the file or folder in the explorer view. You will see the number of changes on the right.

Make sure to explore the GitLens documentation to discover more features tailored to your own workflows and tastes.