Push a Local Git Repository to the Project’s Git Repository
If your application source code files are available in a local Git repository, you can push them to a project’s empty Git repository.
You can use any Git client to push the local Git repository to the remote Git repository:
-
Copy the URL for the project’s Git repository.
On the Git page, from the Repositories drop-down list, select the Git repository. From the Clone drop-down list, click Copy to clipboard
to copy the HTTPS or the SSH URL, as shown:
-
Open the Git client - perhaps the Git CLI.
-
Navigate to the local Git repository directory.
-
Add the project’s Git repository as the remote repository of the local repository. Use the Git repository’s URL copied from step 1.
For example, if you’re using the Git CLI, use the
git remote add <remote-repository-name> <repository-url>
command.Here's an example that uses HTTPS:
git remote add origin https://john.doe%40example.com@developer.oraclecloud.com/developer1111-usoracle22222/s/developer1111-usoracle22222_myproject/scm/developer1111-usoracle22222_myproject.git
Here's an example that uses SSH:
git remote add origin ssh://usoracle22222.john.doe%40example.com@developer.oraclecloud.com/developer1111-usoracle22222_myproject/developer1111-usoracle22222_myproject.git
Both examples add a remote repository
origin
for the repository atdeveloper.oraclecloud.com/developer1111-usoracle22222_myproject/developer1111-usoracle22222_myproject.git
. -
Push the local Git repository to the project’s Git repository.
For example, if you’re using the Git CLI, use the
git push
command:git push —u origin main
-
In your project, open the Git page and check the files in the project’s Git repository.