Upload Files to a Project Using the Git Command Line
This 15-minute tutorial shows you how to create a project in Oracle Visual Builder Studio and upload an application’s files to the project’s Git repository using the Git command-line tool.
Background
Oracle Visual Builder Studio (VB Studio) is a DevOps and lifecycle management tool that provides the infrastructure for developing and deploying applications. You can use VB Studio’s source control capabilities to manage your application’s code, for example, when you’ve developed an application locally and want to start managing its files with source control. To do this, simply upload your application’s files to a VB Studio project, which (among other things) provides a Git repository for storing your source code.
To upload your application to VB Studio, you create a project with a Git repository. After creating the project, you clone the project’s Git repository to your computer, copy the application’s files to it, add and commit the files to the local Git repository, then push the commits to the project’s Git repository
What Do You Need?
- A web browser
- Your Oracle Cloud account credentials
- Access to a VB Studio instance
- DEVELOPER_ADMINISTRATOR or DEVELOPER_USER identity domain role assigned to you
- A Git command line tool. To access Git, you can use the Git GUI or command-line tools - though in this tutorial, we’ll use the Git command-line tool. Download Git tools from https://git-scm.com/downloads and install them on your computer.
- Download the sample application, a Java SE web application that uses Servlets, JSP, Bootstrap, and embedded Tomcat.
Create a Project
-
Sign in to VB Studio.
-
On the Organization page, click + Create.
-
On the New Project wizard’s Project Details page, enter these values, then click Next:
- Name: Employee App
- Description: A Java SE web application with Servlets, JSP, Bootstrap, and embedded Tomcat.
Description of the illustration 1_1_projectwizard_projectdetails.png
-
On the Template page, select Initial Repository and click Next.
Description of the illustration 1_2_projectwizard_template.png
-
On the Project Properties Initial Repository page, seelct:
- Initial Repository: Initialize repository with README file
- Wiki Markup: Markdown
Description of the illustration 1_3_projectwizard_projectproperties.png
-
Optionally, on the Team page, add members to the project.
-
Click Finish. Wait for the project’s provisioning to complete. After that’s done, the Project Home page opens.
Clone the Project’s Git Repository
-
On your computer, open the Git command line.
-
Switch to the folder where you want to store the project. For example:
$ cd MyApps
-
In the left navigation bar, click Git
to access your project’s Git repository.
-
From the Clone drop-down list, click Copy
to copy the Git repo’s URL to copy the URL to your clipboard.
-
On the Git command line, enter
git clone
and paste the URL you copied previously, for example:$ git clone https://mary.jane@environment.developer.test.com/vbcsinfraacct/employee-app_12345/scm/employee-app.git
-
Click Enter.
The cloning process starts. Enter your VB Studio password when prompted.
Tip: If you run into an authentication error, especially if you’ve logged in using your organization’s SSO, try again using a personal access token instead of your password.
You should see something like this:
$ git clone https://mary.jane@environment.developer.test.com/vbcsinfraacct/employee-app_12345.git Cloning into 'employee-app'... remote: Counting objects: 3, done remote: Finding sources: 100% (3/3) remote: Getting sizes: 100% (2/2) remote: Compressing objects: 100% (55/55) remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done.
-
Open the cloned repository’s directory. You’ll notice a
README.md
file and a.git
directory created there. Don’t delete or rename the.git
directory, as it contains necessary Git repository files. Here’s an example of the employee-app project’s Git repo cloned under the MyApps directory:
Add the Sample Application Files to the Cloned Git Repository
-
Extract the sample application files from the .zip file to the cloned repository’s directory, for example:
Description of the illustration 3_1_cloned_repo_with_files.png
-
Open the
README.md
file in a text editor. -
Copy this text, paste it in the
README.md
file, and save the file:# Employee Sample Application The Employee Sample Application is a simple Java web app that implements CRUD operations using Bootstrap to add UI styles, Tomcat as the embedded server, and Maven to compile and package the dependencies needed to run the web app. Application files: * `src` directory: contains source files * pom.xml: defines dependencies required to run Tomcat in embedded mode, and plug-ins to compile and package the application in a single uber JAR * manifest.json: provides metadata of the Java application, including the Java version and the command to run the application
-
On the Git command line, change to the cloned repository directory, for example:
$ cd /c/MyApps/employee-app
You’ll need to do this because after the project Git repository is cloned, you aren’t automatically navigated to the directory. After you change to the cloned repository directory, notice the
(main)
after the path, indicating the default Git repository branch. For example,/c/MyApps/employee-app (main)
. -
To tell Git to include all your changes in the next commit, stage your files using the
git add
command:$ git add .
-
Enter the
git status
command to confirm that all files were staged.$ git status On branch main Your branch is up to date with 'origin/main'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: README.md new file: manifest.json new file: pom.xml new file: src/assembly/distribution.xml new file: src/main/java/com/example/employees/Employee.java new file: src/main/java/com/example/employees/EmployeeList.java new file: src/main/java/com/example/employees/EmployeeService.java new file: src/main/java/com/example/employees/EmployeeServlet.java new file: src/main/java/com/example/employees/Main.java new file: src/main/webapp/META-INF/context.xml new file: src/main/webapp/WEB-INF/web.xml new file: src/main/webapp/css/bootstrap.min.css new file: src/main/webapp/fonts/glyphicons-halflings-regular.eot new file: src/main/webapp/fonts/glyphicons-halflings-regular.svg new file: src/main/webapp/fonts/glyphicons-halflings-regular.ttf new file: src/main/webapp/fonts/glyphicons-halflings-regular.woff new file: src/main/webapp/fonts/glyphicons-halflings-regular.woff2 new file: src/main/webapp/index.jsp new file: src/main/webapp/js/bootstrap.min.js new file: src/main/webapp/jsp/list-employees.jsp new file: src/main/webapp/jsp/new-employee.jsp
Commit and Push the Sample Application Files to the Project’s Git Repository
-
On the Git command line, enter the
git commit -m "Initial commit"
command to commit the staged files to the local Git repository, withInitial commit
as the commit message.$ git commit -m "Initial commit" [main c869517] Initial commit 21 files changed, 964 insertions(+), 2 deletions(-) rewrite README.md (94%) create mode 100644 manifest.json create mode 100644 pom.xml create mode 100644 src/assembly/distribution.xml create mode 100644 src/main/java/com/example/employees/Employee.java create mode 100644 src/main/java/com/example/employees/EmployeeList.java create mode 100644 src/main/java/com/example/employees/EmployeeService.java create mode 100644 src/main/java/com/example/employees/EmployeeServlet.java create mode 100644 src/main/java/com/example/employees/Main.java create mode 100644 src/main/webapp/META-INF/context.xml create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/main/webapp/css/bootstrap.min.css create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.eot create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.svg create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.ttf create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.woff create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.woff2 create mode 100644 src/main/webapp/index.jsp create mode 100644 src/main/webapp/js/bootstrap.min.js create mode 100644 src/main/webapp/jsp/list-employees.jsp create mode 100644 src/main/webapp/jsp/new-employee.jsp
-
Enter the git command
push -u origin
to push the commits of the main branch in the local repo to the remote repo, where “origin” is the default name assigned to the remote project. Make sure you enter your VB Studio password when prompted.$ git push -u origin main Enumerating objects: 39, done. Counting objects: 100% (39/39), done. Delta compression using up to 8 threads Compressing objects: 100% (29/29), done. Writing objects: 100% (37/37), 145.49 KiB | 4.41 MiB/s, done. Total 37 (delta 0), reused 0 (delta 0) remote: [Push Options] Do you want to create a merge request? Use git push -o mr.target=<target-branch> origin <feature-branch> remote: Updating references: 100% (1/1) To https://environment.developer.test.com/vbcsinfraacct/employee-app_12345.git f06779c..c869517 main -> main Branch 'main' set up to track remote branch 'main' from 'origin'.
-
Return to the VB Studio browser tab.
-
In the navigation bar, click Git
and verify that all files are added to the repository.
Description of the illustration 4_1_vbstudio_gitpage_files.png
That’s it! You’ve successfully uploaded the sample application’s files from your computer to the VB Studio project’s Git repository.
For more information, see the Visual Builder Studio Help Center
More Learning Resources
Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.
For product documentation, visit Oracle Help Center.
Upload Files to a VB Studio Project Using the Git Command Line
G34234-02
Copyright ©2018,2025, Oracle and/or its affiliates.