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:

  1. 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 the Copy icon to copy the HTTPS or the SSH URL, as shown:

  2. Open the Git client - perhaps the Git CLI.

  3. Navigate to the local Git repository directory.

  4. 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%40oracle.com@developer.us.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%40oracle.com@developer.us.oraclecloud.com/developer1111-usoracle22222_myproject/developer1111-usoracle22222_myproject.git

    Both examples add a remote repository origin for the repository at developer.us.oraclecloud.com/developer1111-usoracle22222_myproject/developer1111-usoracle22222_myproject.git.

  5. 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

  6. In your project, open the Git page and check the files in the project’s Git repository.