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:
- From the Terminal menu, select Open Terminal. The terminal is opened by default to the folder that is your workspace.
- 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/.
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
Repeat the above steps for the Platform and the Application. In the Project Explorer view, you can see what projects are checked in:
You can add these projects to their git repo:
git add .
git commit -m "add project"
git push https://your_repo/vitis_project master
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
.You can select the Import projects from Git option in the Import Projects wizard:
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:
Then point to your remote Git repo:
You can now see your 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:
You can also pull/push changes to the Git repository using the provided team action in the explorer view as shown below.
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 selectingFigure 11. Git Perspective
- Git Preferences
-
Git preferences can be selected in:Figure 12. Window Preferences