Create your first Git service
Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen
Prerequisites
Section titled “Prerequisites”- You have a STACKIT customer account: Create a customer Account
- You have a STACKIT user account: Create a user account
- You have a STACKIT project: Create a project
Prepare, order and create an instance
Section titled “Prepare, order and create an instance”In this Getting started guide you will create an instance and configure it. This guide shows the most common settings for a small developer environment. When following this guide, you will work with the STACKIT Portal.
- Visit the STACKIT Portal.
- On the sidebar click on Git.
- On the bar on the top click on Create Git.
After completing the steps, you see an overlay with three sections (General information, Plans and Storage).
General information
Section titled “General information”- Enter a name for the instance (e.g. the company name)
- Choose the plan Git10 unless you know in advance how much resources you’ll need.
Storage
Section titled “Storage”Once the capacity is exceeded, the disk space and object storage space will be upgraded to accommodate required capacity. Instance capacity upgrades are available in 11GB increments, which include: 1GB Disk Space, 10GB Object Storage and 1 Additional User.
After reviewing every setting, click on Order fee-based to create your new instance. Then you will see a confirmation that your instance is created. Your new instance will be added to the list of instances. After a few minutes it will switch from Creating to Ready.
Create a repository in STACKIT Git
Section titled “Create a repository in STACKIT Git”-
Visit the STACKIT Portal.
-
In the sidebar click on Git.
-
In the list of all available instances click on the Access URL.
(e.g https://[instanceName].git.onstackit.cloud)
-
On the bar on the top click on Sign In and then Sign in with STACKIT IDP.
-
After login, you see the start page of STACKIT Git.
-
Click the ”+“-Sign on the top right of the page and select + New repository from the menu.
-
Enter the details of your new repository.
For a quick start, specify only Owner and Repository name and use default values or fill the fields later for all other entries. A complete list with all avaible parameters is avaible in How to set up a Git Repository
Form field Explanation Owner Here, you can specify whether you want this to be your own personal project or whether you want it to be part of an organization that you’re a part of Repository name A name for your repository (which will also be part of its path) -
Click Create Repository.
Connect to the Git repository
Section titled “Connect to the Git repository”Generate credentials for the git repository
Section titled “Generate credentials for the git repository”-
On the top bar, click on your profile icon and select settings in the dropdown menu.
-
In the Public profile area, copy your username.
-
Select Applications in the left navigation bar.
-
Create a new Access token.
- Enter a Token name
- Select All
- Open Select permissions and select at least repository read and write
- Click Generate token. The Token is only visible once. Store it for future use.
Alternative: Authenticating with SSH Keys
Section titled “Alternative: Authenticating with SSH Keys”- Go to your user settings like described above.
- Select SSH / GPG keys in the left navigation.
- Click Add key to add a new SSH key.
For instructions on how to generate SSH keys, refer to Generate and Upload SSH Keys.
Connect to the repository
Section titled “Connect to the repository”If you want to start a fresh project (that is, if you do not already have source code that you want to upload to STACKIT Git), the quickest way to get started is to clone your newly created repository like this:
-
Create a dedicated directory for your new project and navigate to it on the command line.
Terminal window mkdir my-new-projectcd my-new-project -
Clone the repository by executing the command git clone.
Terminal window git clone [url] -
Enter your username
-
Enter your access token
-
Navigate to the cloned repository.
Terminal window cd [repositoryName]
If you already have written source code that you now would like to upload to STACKIT Git, follow these steps:
-
Initialize a Git Repository: Unless you already have a Git Repository initialized in your local source tree, run git init in your project’s directory.
Terminal window git init -
Add STACKIT Git as the repository’s origin.
Terminal window git remote add origin [url] -
Push the existing repository.
Terminal window git push -u origin main
Make a commit to the repository
Section titled “Make a commit to the repository”-
Create a new file or edit a file in the repository
-
Add each modified file to your commit
Terminal window git add . -
Commit your changes with a message
Terminal window git commit -m "[commit message]" -
Push your changes to STACKIT Git
Terminal window git push
Reload the overview page. The just pushed files and changes are visible in your STACKIT Git repository.
Now you executed some basic commands. From here on you can dig deeper with the How-tos.