Compare commits

...

10 Commits

Author SHA1 Message Date
Taylor Barnett
ec74e0e88c Merge branch 'taylor-projects-git' of https://github.com/stoplightio/docs into taylor-projects-git 2018-04-10 17:00:51 -05:00
Taylor Barnett
e4448b79b5 fix conflict 2018-04-10 17:00:22 -05:00
Robert Wallach
53da0d12c1 Update git.md 2018-04-10 16:36:28 -05:00
Robert Wallach
78842d72f3 Update git.md 2018-04-10 15:01:51 -05:00
Taylor Barnett
bccbaa6598 add line clarifying what article does 2018-04-09 19:46:01 -05:00
Taylor Barnett
0b02a2e0ba remove double parentheses 2018-04-09 19:44:18 -05:00
Taylor Barnett
211c79848f add image URL 2018-04-09 19:42:39 -05:00
Taylor Barnett
2917e69874 copy fixes 2018-04-09 19:40:43 -05:00
Taylor Barnett
f5a58984ff WIP 2018-04-09 19:35:21 -05:00
Taylor Barnett
9b1f44ae10 WIP 2018-04-06 14:28:52 -05:00

61
articles/projects/git.md Normal file
View File

@@ -0,0 +1,61 @@
# Git Repositories
## What
The Stoplight Platform is built on top of Git. This means that all your projects are Git repositories and that our platform benefits from all the additonal functionality provided by Git. To access the Git funtionality, you will need to clone your Git repository by generating an Access Token.
> You can also use Access Tokens to access the Stoplight API, authenticate Prism in a continuous integration enviornment, and access the underlying Git repositories for projects. You can make this part of your Git workflow, add it to scripts, or your CI/CD process
## Who
If you have write access to a project, you will be able to:
* Pull projects via Git
* Commit to projects via Git
* Push changes to projects via Git
If you have read access to a project, you will be able to:
* Pull your project via Git
## How to Clone Your Stoplight Git Repository
1. Select the **Settings** tab on the platform homepage
2. Select **Access Tokens** from the left
![Access Tokens](https://github.com/stoplightio/docs/blob/develop/assets/images/access-tokens.png?raw=true)
3. Create a token to access projects that your Stoplight account has proper permissions for (These permissions match the ones in the Stoplight UI)
> You can name your token whatever you want. Once you have created the token, copy it, and only store it in a safe location. Once you close the window, you will not see it again
3. On your machine, store your access token as an environmental variable (recommended)
For example, on Mac/Linux:
```
export STOPLIGHT_TOKEN="1234567890"
```
4. You can then `git clone` the repo, replace `{stoplight-username}`, `{username}`, and `{project-name}` with the appropriate information:
```
git clone https://{stoplight-username}:$STOPLIGHT_TOKEN@git.stoplight.io/{username}/{project-name}.git
```
For example:
```
git clone https://taylor:$STOPLIGHT_TOKEN@git.stoplight.io/taylor/test-new.git
```
> If the project is associated with an organization and not a personal project, replace `username` with `organization-name`
5. Now you can make changes to your files, commit, and push to your master branch. You can see these changes in the Stoplight UI as well as the "History of Changes"
> Remember: You will only see changes on the master branch in the UI at this time.
---
**Related Articles**
- [Change a Project Member's Role](/platform/projects/change-a-members-role)
- [Make Your Project Private/Public](/platform/projects/visibility)
- [Invite People to Organization](/platform/organizations/invite-people)
- [Add People to a Team](/platform/organizations/teams/add-people)