In order to give you better service we use cookies. By continuing to use our website, you agree to the use of cookies as described in our Cookie Policy

Are you a Kong Gateway user? We'd love your feedback. Take the Survey

Kong Logo
  • Get Started
  • Products
    • kong-enterprise Kong Enterprise
      • Kong Enterprise

        End-to-end connectivity platform

      • Kong Mesh

        Universal service mesh

      • Kong Studio

        Empower your developers

      • Dev Portal

        Accelerate innovation

      • Kong Manager

        Manage all your services

      • Kong Immunity

        Autonomously identify issues

      • Kong for Kubernetes

        Native Kubernetes Ingress Controller

      • Enterprise Plugins

        Instantly implement policies

      • Kong Vitals

        Monitor your Kong Enterprise

      • Get Started
    • Built on an Open-source Foundation
      • kong-gateway Kong Gateway

        API Gateway

      • kuma Kuma

        Service Mesh

      • insomnia Insomnia

        API Design and Testing

      • Install
    • Kubernetes & Subscriptions
      • Kubernetes Ingress Controller

        Ingress and CRDs

      • Subscriptions

        Kong Gateway and Enterprise features

  • Solutions
    • Use Cases
      • Decentralize Apps and Services

        Accelerate your journey into microservices

      • Secure and Govern APIs

        Empower teams to provide security, governance and compliance

      • Create a Developer Platform

        Rapidly design, publish and consume APIs and services

    • Deployment Patterns
      • API Gateway

        Take control of your microservices with the world’s most popular API gateway

      • Kubernetes

        Own your Kubernetes cluster by using Kong as an Ingress Controller

      • Service Mesh

        Build, secure and observe your modern Service Mesh

  • Plugins
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Docs
    • Documentation
      • Kong Gateway
      • Kong Enterprise
      • Kong Mesh
      • Kong Studio
      • Plugins Hub
  • Resources
    • Learning
      • eBooks
      • Webinars
      • Briefs
      • Blog
    • Community
      • Community
      • Kong Nation
      • Kong Summit
      • GitHub
    • Support
      • Enterprise Support Portal
      • FAQS
      • Kong Professional Services
      • Kong University
  • Company
    • About
    • Customers
    • Investors
    • Careers
    • Partners
    • Press
    • Contact
  • Get Started
Kong Gateway Kong Enterprise Kong Studio Getting Started
Edit this Page
Documentation

Git Sync with Kong Studio

  • 1.0.x (latest)
Careful! You are browsing documentation for an outdated version of Kong . Go here to browse the documentation for the latest version.

Table of Contents

  • Introduction
    • Remote Repository Settings
    • Cloning an Existing Repository
    • Commits and History
    • Pushing Changes Remotely
    • Managing Branches
    • Pushing Changes
    • Pulling Changes
    • Conflict Resolution

Introduction

Kong Studio is a collaborative tool for creating, managing, and sharing API specifications. This collaboration is built on the ubiquitous version control system Git, which was chosen to allow Kong Studio to fit within the existing editing, review, testing, and deployment workflows that companies and teams already have in place for source code.

To demonstrate the various features of Git Sync, we will be using the demo Swagger Petstore API.

Introduction

Remote Repository Settings

To configure a repository, click the “Setup Git Sync” button at the bottom of the sidebar.

  • Git URI – The URI of the git repository you wish to connect to. Note, only https URLs are supported.
  • Author Name/Email – Git author metadata that will be stored with each commit
  • Authentication Token – The token needed to authenticate with remote repository provider (GitHub, Bintray, etc)

Repo Settings

Once complete, click “Done” and the repository settings will be persisted for future operations. Author details and token can be updated after if needed.

Cloning an Existing Repository

If a team member has already pushed a Studio project to a remote repository, it can be cloned via the main menu in the top-left of the application. Here, you will see the same Repository Settings dialog to configure remote access.

Note: Studio does not currently support repositories that contain files outside the root ".studio" folder.

In order to clone, the repository must exist and also contain the root .studio/ folder.

Cloning a Repo

Commits and History

A new commit can be created via the git menu at the bottom of the sidebar.

In the following example, you can see we are creating a new commit and adding the API Spec object. The descriptive message that will be saved in Git is entered in the input area. Since this is our first commit, all objects are currently “unversioned” (not yet saved in the repository).

Create a new commit

Once we create the commit, we can view it in the repository history.

View it in the repo history

And once we have committed resources to the repository, the next time we modify them they will appear as modified objects instead of unversioned and will be automatically selected as candidates for the commit.

Modify Object

Pushing Changes Remotely

Commits only exist locally when created. In order to collaborate, changes need to be pushed to the remote repository.

Push Changes

Managing Branches

When working with Git, it is recommended to perform changes in separate branches. This has two benefits:

  1. Reduces the chances of merge conflicts when team members are making frequent changes
  2. Supports a pull-request workflow where team members can leave feedback before merging

Local branches can be created from the branch management dialog. This dialog presents both local branches and remote branches. Note, remote branches will only appear if they do not already exist locally.

Managing Branches

Pushing Changes

Commits and branches only exist locally when created. A push needs to be done to share the commits and history of a branch remotely.

Pushing Changes

Pulling Changes

If a team member makes a change to the remote repository, they will need to be “pulled” down in order to use locally. Pulling will fetch the current branch from the remote repository and merge any changes locally.

Pulling Changes

Conflict Resolution

Studio does not currently support the ability to resolve conflicts. If changes were made locally and remotely, a pull may fail.

Here are some strategies to help with conflicts:

  • Each team member should make changes in a separate branch to avoid conflicts. Changes should be merged into master once reviewed and approved by other team members (eg. GitHub pull request)
  • If a conflict occurs on pull, delete the branch locally and re-fetch it from the branches dialog
  • Kong
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Gateway
    • Kong Enterprise
    • Get Started
    • Subscriptions
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2021