Upload File From Desktop to Git Command Line
Before You Begin
This fifteen-minute tutorial shows you how to create a project in Oracle Visual Builder Studio (VB Studio) and upload an application'south files to the project's Git repository using the Git command line tool.
Background
Oracle Visual Builder Studio (VB Studio) is a DevOps and life cycle direction tool, and provides the infrastructure to help you build and deploy apps.
To upload your awarding to VB Studio, yous must create a projection with a Git repository. Later you create the project, you clone the project'due south Git repository to your reckoner, copy awarding's files to it, add and commit the files to the local Git repository, and so push the commits from the local Git repository to the project'south Git repository.
What Do Yous Demand?
- A web browser
- Your Oracle Cloud business relationship credentials
- Access to a VB Studio instance
- DEVELOPER_ADMINISTRATOR or DEVELOPER_USER identity domain office assigned to y'all
- Git control line tool
To access Git, you tin can use both Git graphical user interface and command line tools. In this tutorial, yous'll utilize the command line tool to run Git commands. Download Git tools from https://git-scm.com/downloads and install them on your computer. - Sample application
Click here to download the Employee sample application, a Coffee SE web application that uses Servlets, JSP, Bootstrap, and embedded Tomcat.
Create a Project
- Sign in to VB Studio.
- On the Organization folio, click + Create.
- On the New Project wizard'southward Project Details page, enter these values, and so click Next:
- Name:
Employee App - Description:
A Java SE spider web awarding with Servlets, JSP, Bootstrap, and embedded Tomcat
Description of the analogy projectwizard_projectdetails.png - Name:
- On the Template folio, select Initial Repository and click Adjacent.
Description of the illustration projectwizard_template.png - On the Projection Properties Initial Repository page, make sure that these options are selected:
- Initial Repository: Initialize repository with README file
- Wiki Markup: Markdown
Clarification of the analogy projectwizard_projectproperties.png - Click End.
Await for the project'due south provisioning to complete. After provisioning completes, the Project Domicile folio opens.
Clone the Project's Git Repository
- On your computer, open the Git command line.
- Change the directory to where yous want to clone the project'southward Git repository, as in this example:
$ cd MyApps
- Go back to the VB Studio projection.
- In the navigation bar, click Git
. - From the Clone driblet-down listing, click the HTTPS URL'south Re-create
icon to copy the URL.
Description of the analogy vbstudio_git_urls.png - On the Git command line, enter
git cloneand paste the copied URL.
Example:$ git clone https://alex.cloud%40example.com@vbs-vbsdemo.programmer.ocp.oraclecloud.com/vbs-vbsdemo/s/vbs-vbsdemo_employee-app_1234/scm/employee-app.git
- Press Enter.
The cloning process starts. Enter your VB Studio password when prompted.
Your log should wait like to this:$ git clone https://alex.cloud%40example.com@vbs-vbsdemo.developer.ocp.oraclecloud.com/vbs-vbsdemo/s/vbs-vbsdemo_employee-app_1234/scm/employee-app.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% (iii/iii), washed.
- In the File Explorer or the File Managing director, open the cloned repository'due south directory.
Y'all'll notice aREADME.mdfile and a.gitdirectory created in that location. Don't delete or rename the.gitdirectory, as it contains necessary Git repository files.
Instance:
Description of the illustration cloned_repo.png
Add the Sample Application Files to the Cloned Git Repository
- Extract the sample application files from the zip file to the cloned repository'south directory.
Instance:
Description of the illustration cloned_repo_with_files.png - Open up the
README.physicianfile in a text editor. - Copy the following text, paste it in the
README.physicianfile, and relieve the file.#Employee App Sample Application This application is a simple Java web application of employees that implements the Grime operations using Bootstrap to add UI styles, Tomcat equally the embedded server, and Maven to compile and package the dependencies needed to run the web awarding standalone. Application files: * `src` directory: contains source files * pom.xml: defines dependencies required to run Tomcat in the embedded way, and the plugins to compile and parcel the application in a unmarried uber JAR * manifest.json: provides metadata of the Coffee application, including the Coffee version and the control to run the awarding
- On the Git control line, modify to the cloned repository directory.
/c/MyApps
This is necessary considering afterwards the projection Git repository is cloned, you lot are non automatically navigated to it. After you alter to the cloned repository directory, you'll notice
$ cd employee-app(primary)later the path.primaryis the default Git repository branch.
Case:
/c/MyApps/employee-app (master) $
- Enter the
git add together .command to add or stage the sample application'southward files to the local Git repository index.$ git add together .
- Enter the
git statuscommand to verify that all files take been staged.$ git status On branch master Your branch is up to appointment 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/instance/employees/Employee.java new file: src/main/java/com/instance/employees/EmployeeList.coffee new file: src/main/coffee/com/example/employees/EmployeeService.java new file: src/primary/java/com/example/employees/EmployeeServlet.java new file: src/master/java/com/example/employees/Main.java new file: src/main/webapp/META-INF/context.xml new file: src/master/webapp/Web-INF/spider web.xml new file: src/main/webapp/css/bootstrap.min.css new file: src/main/webapp/fonts/glyphicons-halflings-regular.eot new file: src/primary/webapp/fonts/glyphicons-halflings-regular.svg new file: src/master/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/chief/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 control line, enter the
git commit -grand "Initial commit"command to commit the staged files to the local Git repository and add togetherInitial commitevery bit the commit message.$ git commit -1000 "Initial commit"
[master c869517] Initial commit
21 files inverse, 964 insertions(+), 2 deletions(-)
rewrite README.medico (94%)
create fashion 100644 manifest.json
create manner 100644 pom.xml
create mode 100644 src/assembly/distribution.xml
create mode 100644 src/main/coffee/com/case/employees/Employee.java
create way 100644 src/chief/java/com/example/employees/EmployeeList.java
create style 100644 src/main/java/com/case/employees/EmployeeService.java
create manner 100644 src/master/java/com/example/employees/EmployeeServlet.coffee
create mode 100644 src/main/coffee/com/case/employees/Main.java
create style 100644 src/main/webapp/META-INF/context.xml
create style 100644 src/main/webapp/Web-INF/web.xml
create mode 100644 src/main/webapp/css/bootstrap.min.css
create fashion 100644 src/main/webapp/fonts/glyphicons-halflings-regular.eot
create mode 100644 src/principal/webapp/fonts/glyphicons-halflings-regular.svg
create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.ttf
create style 100644 src/principal/webapp/fonts/glyphicons-halflings-regular.woff
create mode 100644 src/primary/webapp/fonts/glyphicons-halflings-regular.woff2
create mode 100644 src/main/webapp/index.jsp
create mode 100644 src/primary/webapp/js/bootstrap.min.js
create way 100644 src/main/webapp/jsp/list-employees.jsp
create mode 100644 src/main/webapp/jsp/new-employee.jsp - Enter the
git push -u origin maincommand to push the commits of the local Git repository chief branch to the project Git repository.
In the command,originis the default name assigned to the remote projection Git repository. Enter your VB Studio password, when prompted.$ git push -u origin primary Enumerating objects: 39, washed. Counting objects: 100% (39/39), done. Delta compression using up to viii threads Compressing objects: 100% (29/29), washed. Writing objects: 100% (37/37), 145.49 KiB | iv.41 MiB/due south, done. Total 37 (delta 0), reused 0 (delta 0) remote: [Push Options] Practise 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://vbs-vbsdemo.developer.ocp.oraclecloud.com/vbs-vbsdemo/due south/vbs-vbsdemo_employee-app_1234/scm/employee-app.git f06779c..c869517 master -> master Branch 'master' set up to rail remote co-operative 'master' from 'origin'.
- Open the browser with the the VB Studio project.
- In the navigation bar, click Git
and verify that all files are added to the repository.
Description of the illustration vbstudio_gitpage_files.png
That's it! Yous've successfully uploaded the sample awarding's files from your computer to the VB Studio project's Git repository.
Want to Learn More?
- Visual Architect Studio Assist Center
Source: https://docs.oracle.com/en/cloud/paas/visual-builder/tutorial-create-project-upload/index.html
Post a Comment for "Upload File From Desktop to Git Command Line"