Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

source-control.md

93 lines3.2 KB

1# Source control
2​
3T3 Code integrates with GitHub, GitLab, Bitbucket, and Azure DevOps to clone and publish
4repositories, create pull requests, and review changes.
5​
6## Connect an account
7​
8Install Git and configure authentication on the machine running your T3 Code server. For a remote
9environment, do this on the remote machine. After signing in, open **Settings → Source Control**
10and choose **Rescan**.
11​
12### GitHub
13​
14Install [GitHub CLI](https://cli.github.com/) 2.81.0 or newer, then sign in:
15​
16```bash
17gh auth login
18```
19​
20### GitLab
21​
22Install [GitLab CLI](https://gitlab.com/gitlab-org/cli), then sign in:
23​
24```bash
25glab auth login
26```
27​
28### Bitbucket
29​
30Set an access token in the server's environment:
31​
32```bash
33export T3CODE_BITBUCKET_ACCESS_TOKEN="your-access-token"
34```
35​
36Or use an Atlassian account email and API token with read/write access to repositories and pull
37requests, plus user read access (`read:user:bitbucket`):
38​
39```bash
40export T3CODE_BITBUCKET_EMAIL="you@example.com"
41export T3CODE_BITBUCKET_API_TOKEN="your-token"
42```
43​
44The access token takes precedence if both are configured. Restart the server after changing these
45variables.
46​
47### Azure DevOps
48​
49Install [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/), add the DevOps extension, and sign in:
50​
51```bash
52az extension add --name azure-devops
53az login
54```
55​
56## Clone or publish a project
57​
58Use **Add Project** in the command palette (`Cmd/Ctrl+K`) to clone a repository. Choose a hosting
59provider or paste a Git URL, then choose where to save it.
60​
61For a local Git repository without a remote, **Publish Repository** creates a hosted repository,
62adds it as `origin`, and pushes your commits. If there are no commits yet, it creates the remote;
63make your first commit before pushing.
64​
65## Create a pull request
66​
67Use a thread's Git actions to commit, push, and create a pull request. T3 Code can generate commit
68messages, review titles, and descriptions from your changes.
69​
70Choose the writing style and model in **Settings → Source Control**. **Repository conventions**
71uses the project's instructions and recent commit subjects.
72​
73## Review and merge
74​
75Open **Pull requests** to review changes and comments, request reviewers, check out a branch,
76or merge. You can edit review titles and descriptions and your own comments where the host allows it.
77GitLab calls these merge requests.
78​
79GitHub, GitLab, and Azure DevOps support auto-merge while checks are outstanding. GitHub also
80supports approving waiting fork workflows and opening a revert pull request for a merged change.
81​
82For Azure DevOps, use the host website to view diffs or change comments. Bitbucket does not support
83reopening a declined pull request.
84​
85## Troubleshooting
86​
87- **Not authenticated:** run the provider's login command on the server, then rescan. For Bitbucket,
88 confirm the running server received the environment variables.
89- **GitHub sign-in cannot be verified:** update GitHub CLI to at least 2.81.0.
90- **Push fails despite a connected account:** check the Git remote's credentials. SSH and HTTPS
91 remotes can require separate setup from the hosting provider's API access.
92- **A review cannot load:** open it on the host website while resolving connectivity, permissions,
93 or rate limits.