Use Git Commands to Manage Files
To access and manage your project’s Git repository files from your computer, use a Git client - perhaps the Git CLI.
Here are some of the most common Git commands you can run in the Git CLI to work on files in your local Git repository:
Run this command ... | To: |
---|---|
git clone <repository-url> |
Clone a project's Git repository to your computer:
Note: Git over HTTPS works if your Cloud account uses federation with Oracle Identity Cloud Service. If you are federating with other identity providers, such as Microsoft Azure Active Directory or Microsoft Active Directory, Git over HTTPS won't work. We recommend using Git over SSH instead, when you use federation with identity providers other than Oracle Identity Cloud Service. |
|
Add a file that you've added to the repository's directory to the repository's index:
Add all new files to the index:
To add a directory and all its contents to the index, navigate to the directory and use this command:
|
|
Remove a file from the repository:
|
|
Check the status of added and edited files:
|
|
Create a branch:
List all branches in the repository:
Delete a local branch:
If the branch contains commits that haven't been merged into any
other local branches or pushed to a remote repository, Git may not
perform the deletion. This protects you from inadvertently losing
commit data. To force the deletion regardless, use the
To delete a remote branch, you must use the
|
|
Checkout and switch to a branch:
Pass the
|
|
Merge a branch with the checked out branch:
|
git commit |
Commit changes to the local Git repository:
|
git pull |
Incorporate changes from the project's Git repository to the local Git repository:
|
|
Push commits to the project's Git repository:
|
To display the Git help index, use the git help
command. Use the
git help git
command to open the help index in a web browser. To
display help for a particular command, use the git help
<command>
.