Source Control or Version Control techniques are widely used in the software development flow. This chapter describes how to use the Git integration in Vitis unified IDE .
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 New 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 are displayed in the source control view and vice versa.
Add New File for Source Control
To add a file for source control, you can do the following:
Right click the file you want to add and select + Stage Changes
This GUI is equivalent to the following git command.
git add <file name>
Add Components for Source Control
- Switch to Source Control view
- Switch to view as tree
- Right click the component you want to add for source control
and select + Stage Changes. This action will add all the
files for this component to do source control.
- Right click the component and select - Unstage changes
This GUI is equivalent to the following git command.
git add platform/
Commit the Changes
To commit the change, you can do either of the following:
Input the commit message and Press Ctrl + Enter after you select the git view.
This GUI is equivalent to the following git command:
git commit -m <commit message>
Push the Project to the Remote Repository
To push to your remote repository, you can do either of the following:
git push --set-upstream origin
master
- origin: this is the remote repo address
- master: this is the branch of your local workspace coed
version.
git push https://your_repo/vitis_project master
git init
, it automatically creates a branch named master. You can use git branch <branch name> to create a new branch.You can find your local project is in the remote repository.