Upload Files From Your Computer to the Project’s Git Repository
After using a Git client to clone the project’s Git repository to your computer, adding files, committing the changes to the cloned Git repository, you can then push the commit to the project’s Git repository:
-
Copy the Git repository URL.
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:
-
Open the Git client - perhaps the Git CLI.
-
Navigate to the directory where you want to clone the remote Git repository.
If the directory into which you want to clone the repository isn't empty, you'll need to create a new subdirectory and clone the repository into it. You can only perform a cloning operation into an empty directory.
-
Using the Git client, clone the project’s Git repository.
For example, if you’re using the Git CLI, use the
git clone <repository-url>
command. Use the Git repository’s URL copied from step 1.Here's an example that uses HTTPS:
git clone 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 clone ssh://usoracle22222.john.doe%40oracle.com@developer.us.oraclecloud.com/developer1111-usoracle22222_myproject/developer1111-usoracle22222_myproject.git
-
Open the directory to access files.
You’ll notice a
.git
subdirectory in the repository directory. Don’t add, delete, or modify the files of the.git
subdirectory. -
Copy your application files to the cloned Git repository directory.
-
To add new files to the repository, use the Git client to add them to the repository index.
For example, if you’re using the Git CLI, use the
git add
command:git add readme.txt
To add a directory and its files, navigate to the directory and use
git add .
-
Commit the updated files to the cloned Git repository.
For example, if you're using the Git CLI, use the
git commit
command to save the changes:git commit -am "Sample comment"
-
Push the commit from the cloned Git repository to the hosted Git repository.
For example, if you're using the Git CLI, use the
git push
command:git push origin main