Skip to content

Create a project from Git (freeze at a commit)

Understand can clone a remote repository and build the project directly from it — and pin the analysis to a specific commit so results are reproducible.

In the New Project Wizard

On the Where Is Your Source Code? page, use the Clone Your Remote Git Project section:

  1. Remote Git URL — paste the repository URL (GitHub, Bitbucket, and so on).
  2. Browse — pick an empty local directory to clone into.
  3. Click Clone. Understand runs your installed git and shows progress; it reports "Git repository has been successfully cloned." when done.

Freeze at a commit (optional)

Under Git Options:

  • Freeze at commit hash — pin the project to one commit so re-analysis always reflects that exact snapshot ("Freeze this project at a specific point in time").
  • Comparison commit hash — an older commit that Understand uses to create a second project for historical comparison.

Continue through the rest of the wizard as usual — see Create your first project.

Note

Cloning uses the git already installed on your machine. If the clone fails, the wizard shows the Git error text; check the URL and your credentials/network.

From the command line

und create accepts Git options for scripted, reproducible project creation:

und -db myProject.und create -gitrepo <path-to-repo> -gitcommit <githash> -languages c++ ...
  • -gitrepo <path> — the local repository the project is built from. If omitted, Understand uses the reference database's repository when -refdb is given, otherwise the new database's own directory.
  • -gitcommit <githash> — freeze the analysis at this commit.
  • -refdb <dbname.und> — copy the settings from an existing database instead of starting empty; the new project is also registered as a comparison project in that database.

-gitcommit doesn't choose the files

It only changes where file contents are read from — the commit you pinned. Which files are in the project depends on whether you pass -refdb:

  • Without -refdb the new database starts empty. Add files yourself with und add (see manage the file set), or it will analyze nothing.
  • With -refdb the reference project is copied — settings and its file set — then the file set is rescanned against the pinned commit, dropping directories that don't exist in it.