Getting started with Git

Create a repository, push to it over HTTPS, open a pull request and merge it, in about ten minutes.

Last updated 18 November 2026View as Markdown

Replace these values:

  • my-repo: the repository name.
  • my-org: your organization's name as it appears in clone URLs.
  • 5d6c2a1e-7b3f-4c8d-9e0a-1b2c3d4e5f60: the repository id, which the create call returns and dcloud git repositories list shows.

Prerequisites

  • git on your machine.
  • Permission for git:CreateRepository, git:CreateAccessToken, git:PushRepository, git:CreatePullRequest, git:MergePullRequest, git:DeleteRepository and git:DeleteAccessToken. The AdministratorAccess policy grants all of them.
  • In the Deutsche Cloud Console, also git:ListRepositories to open Git → Repositories (without it the page shows only an access-denied notice).
  • In the Deutsche Cloud Console, also git:GetRepository to open the repository's pages (without it the page is not found).
  • In the Deutsche Cloud Console, also git:GetPullRequest to open the pull request (without it the page is not found).
  • In the Deutsche Cloud Console, also git:ListAccessTokens to open Account → Git tokens (without it the page shows an access-denied notice).
  • For the CLI tab, the dcloud CLI, signed in.

Step 1: Create a repository

  1. Open Git → Repositories, then choose New repository.
  2. On step Identity, under Source, choose Start empty.
  3. For Repository name, enter my-repo.
  4. Under Visibility, keep Private, then choose Continue.
  5. On step Initialisation, keep the default branch main and leave the starter files off, then choose Continue.
  6. On step Access, choose Create repository. The repository's page opens.

Step 2: Create an access token

  1. In the repository, choose Settings, then Access tokens.
  2. Choose Create token.
  3. For Name, enter laptop. For Expires, choose In 7 days.
  4. Keep Repositories at Only my-repo and Permissions at Read and write (clone, fetch and push).
  5. Choose Create token. Copy the token now: it is shown once.

From the CLI and API a token without --repository-ids reaches every repository you can reach, and one without --expires-in-days never expires.

The token has the form prefix.secret.

Step 3: Clone and push

git clone https://git.<platform domain>/my-org/my-repo.git
cd my-repo
echo "# my-repo" > README.md
git add README.md && git commit -m "Add README"
git push origin HEAD:main
git switch -c add-greeting
echo "Hello" > hello.txt
git add hello.txt && git commit -m "Add greeting"
git push origin add-greeting

When git asks, give the token's prefix as the username and its secret as the password. Pasting the whole prefix.secret value into either field also works.

Step 4: Open a pull request

  1. In the repository, choose Pull requests, then New pull request.
  2. Pick add-greeting as the source branch and main as the target branch.
  3. For the title, enter Add greeting.
  4. Choose Create pull request. The pull request opens with its merge status.

Step 5: Merge it

  1. On the pull request, choose the method Squash.
  2. Choose Merge pull request. The pull request shows Merged.

main now holds the greeting. Run git pull origin main to see it locally.

Clean up

Warning

Deleting a repository deletes all of its code, commits, branches, tags and history. It cannot be undone.

  1. In the repository, choose Settings, then Danger zone.
  2. Under Delete this repository, choose Delete repository, type the repository's name to confirm, and choose Delete repository.
  3. Open Account → Git tokens, choose Revoke on the token you created, and confirm with Revoke. (On another repository's Settings → Access tokens, the token's actions menu has Revoke token.)

Next steps

Did this page help you?