Git Integration - 2023.1 English

Vitis Unified IDE and Common Command-Line Reference Manual (UG1553)

Document ID
UG1553
Release Date
2023-07-17
Version
2023.1 English

Software teams can be made up of Multiple members, often in different timezones. As a result, having an effective way to share projects remotely is key to a successful project. This chapter describes how to use the Git integration in Vitis and how to use the Team Actions so that Vitis Projects can be shared.

All of the Team Actions are available in the Explorer view from a right click as shown in the below screen capture. Although Platforms, System Project and Application projects are shown in the hierarchy, those are separate projects. As a result, the team actions need to be performed at each project level.

Source Control

To enable the Source Control view you must initialize your empty workspace as a git repository. After creating an empty workspace, and launching the Vitis Unified IDE to open the workspace, you can add it to your git repository using the following steps:

  1. From the Terminal menu, select Open Terminal. The terminal is opened by default to the folder that is your workspace.
  2. In the Terminal window, type in the command git init and press Enter.

You should see a message such as: Initialized empty Git repository in /tests/temp/workVADD/.git/.

Important: Using the Source Control view with Git requires you to have a User ID and Password established, and provided to the system.

After you create a new component or project in the workspace, Vitis Unified IDE generates a .gitignore file. The .gitignore file can help you filter out the generated files so that it is easier to pick the files for source control. You can open the .gitignore file and edit this file if you have additional requirements.

The Source Control view is a GUI helper for Git. You can use Git commands and the source control view simultaneously for your project. Updates in the command line will show in the source control view and vice-versa.

To add a file for source control, you can do one of the following:

  • Use command git add <filename> in the Terminal.
  • Hover on the file name in the Source Control window and Click + button on the right.

To commit the change, you can do either of the following:

  • Use command git commit -m <commit message>.
  • Input commit message and click the commit button in the Source Control window.

You can find more git operations in the Source Control window by clicking the ... icon on the upper right corner.

Sharing a Project in Git

Assume there is a simple Hello World system application and platform component in your workspace.

Right click on the System Project and select Team > Share Project

Figure 1. Team Actions Menu
Figure 2. Configure Git Repository

Repeat the above steps for the Platform and the Application. In the Project Explorer view, you can see what projects are checked in:

Figure 3.

You can add these projects to their git repo:

git add .
git commit -m "add project"
git push https://your_repo/vitis_project master
Figure 4. Added Projects

Importing the Projects

An existing project from the GIT Repository can be imported using the below options.

The Import Project Wizard can be opened from File > Import.

You can select the Import projects from Git option in the Import Projects wizard:

Figure 5. Import Type

You can set the repository location as either a local repository or URI. Based on the selection, specific pages will be displayed. The Import Wizard from GIT is integrated into the Import Projects wizard to support importing from a local repository as well as importing from a remote repository with a URI. Selected projects are then migrated based on need when you click Finish in the Import Projects Wizard.

Importing the Projects from a remote Git Repository

First select Clone URI:

Figure 6. Clone URI

Then point to your remote Git repo:

Figure 7. Specify Git Repository

You can now see your projects:

Figure 8. Import Projects

You can import projects using the Eclipse workspace or zip file option. The Local Repository path needs to be provided and it will then list the existing projects. The Copy Projects into workspace option should not be selected if you want to retain the local git repository location. Selected projects are then migrated based on need when you click Finish in the Import Projects wizard.

Imported projects are displayed in the Component Explorer view:

Figure 9. Imported Projects

You can also pull/push changes to the Git repository using the provided team action in the explorer view as shown below.

Figure 10. Update Projects in the Repository

Other features

Git Ignore File Creation
For newly created projects, the .gitignore file gets created with the default build configuration folders so that team check-ins will ignore these folders. A sample .gitignore is displayed below.

Shortcut for switching to the Git Perspective
You can easily switch to the Git Perspective by selecting Window > Git Perspective
Figure 11. Git Perspective
Git Preferences
Git preferences can be selected in Window > Preferences:
Figure 12. Window Preferences