Working together with Git
A korAPI collection is a folder of small files: one file for each request, one for each environment. Git keeps that folder on a server your team shares, such as GitHub, GitLab or your company’s own. Everyone has the same collection, and everyone’s changes come together.
You do not need to know Git. korAPI does the Git part for you. The Git bar at the bottom of the sidebar shows your branch and changes, and opens the Git view.
When to use Git, and when to send a file
Section titled “When to use Git, and when to send a file”| You want to… | Use |
|---|---|
| Work on the same collection as your team, every day | Git (this guide) |
| Give someone a copy, once | Export Collection |
With a file, everyone gets their own copy, and changes never come back. With Git, there is one collection, and Pull brings in what others changed.
The words you will see
Section titled “The words you will see”- Repository: the place on the server that holds the collection. It has an address (a URL) like
https://github.com/your-team/shop-api.git. - Commit & Push: send your saved changes to the repository, with a short note of what you changed.
- Pull: get the changes others sent.
- Check for Changes: see whether others sent changes, without touching your files.
- Conflict: you and someone else changed the same request. You choose which version to keep.
What is shared, and what is not
Section titled “What is shared, and what is not”Shared: requests, folders, their order, environments, load tests, flows, snapshots and checks.
Not shared: secret values (passwords, tokens, API keys). They stay in each person’s system keychain, and each person fills them in once on their own computer. Your history, settings and run results are not shared either.
What korAPI’s Git does not do
Section titled “What korAPI’s Git does not do”- One branch. korAPI works on the branch that is checked out, usually main. To make or switch branches, use Git in a terminal or another Git app.
- No checking in the background. korAPI only talks to the server when you choose Pull, Check for Changes, Commit & Push, Share with Git… or Open from Git….
- No new repositories. Make the empty repository on the server’s website first. korAPI only needs its URL.
The story this guide follows
Section titled “The story this guide follows”Ann and Bob test the same API. Ann already has a collection in korAPI. Bob has nothing yet.
- Set up Git once: both of them, on their own computer.
- Share a collection: Ann puts her collection in a new repository.
- Open a teammate’s collection: Bob gets it.
- Every day: send and get changes: they both work on it.
- When you both changed the same request: a conflict, and how to settle it.
- Git messages and what to do: every message korAPI can show, and the fix.
If neither of you has a collection yet, one person makes it first (File › New Collection…) and then follows Ann’s steps.