Fix Git Flow
This commit is contained in:
+6
-1
@@ -14,10 +14,15 @@
|
||||
- Executes Git subprocess commands and displays command output.
|
||||
- Executes provider-specific publication for new remote repositories:
|
||||
- GitHub via `gh` CLI.
|
||||
- Gitea via HTTPS API and token-authenticated initial push.
|
||||
- Gitea via HTTPS API, followed by an SSH or token-authenticated HTTPS push.
|
||||
- Executes provider-specific connection to existing remote repositories:
|
||||
- GitHub by resolving owner or URL input to `origin`.
|
||||
- Gitea by resolving owner, base URL, and SSH/HTTPS transport or full URL input to `origin`.
|
||||
- Synchronizes Gitea connections by inspecting ancestry, fast-forwarding the
|
||||
side that is behind, or asking the user how to resolve divergent histories.
|
||||
- Preserves local history on a backup branch before a user-confirmed local
|
||||
replacement and uses `--force-with-lease` for remote replacement.
|
||||
- Removes local remote configuration through a conditional disconnect action.
|
||||
- Implements file selection for staged and unstaged operations.
|
||||
|
||||
## Public API and Contracts
|
||||
|
||||
+10
-9
@@ -30,14 +30,13 @@
|
||||
|
||||
- If the current directory is not a Git repository, `git-tui` offers setup actions:
|
||||
- Initialize repository only.
|
||||
- Initialize and publish to a new remote repository.
|
||||
- Initialize and publish flow:
|
||||
- Chooses publishing provider: GitHub or Gitea.
|
||||
- Initialize, create a new Gitea remote repository, and sync.
|
||||
- Initialize, connect an existing Gitea remote repository, and sync.
|
||||
- Create and publish flow:
|
||||
- Initializes a local Git repository.
|
||||
- Stages all current files.
|
||||
- Creates an initial commit.
|
||||
- GitHub option creates and pushes via `gh repo create --source=. --remote=origin --push`.
|
||||
- Gitea option creates via HTTPS API, configures `origin`, and pushes with HTTPS authentication using the provided token.
|
||||
- Gitea creation uses the HTTPS API token, then configures and pushes `origin` using the separately selected SSH or HTTPS Git transport.
|
||||
- Optional Gitea environment variables:
|
||||
- `GITEA_URL` or `GITEA_BASE_URL` for instance URL default.
|
||||
- `GITEA_OWNER` for default owner or organization.
|
||||
@@ -47,16 +46,18 @@
|
||||
## Existing Repository Without Remote Flow
|
||||
|
||||
- If the current directory is already a Git repository and has no remotes configured, `git-tui` offers startup actions:
|
||||
- Connect to an existing remote repository.
|
||||
- Connect to an existing Gitea remote repository and sync.
|
||||
- Create a Gitea remote repository and sync (API token required).
|
||||
- Continue without remote configuration.
|
||||
- Quit.
|
||||
- Connect existing remote flow:
|
||||
- Chooses provider: GitHub or Gitea.
|
||||
- GitHub accepts `owner/name` or full clone URL input.
|
||||
- Gitea accepts `owner/name` or full clone URL input, and uses `GITEA_URL` or `GITEA_BASE_URL` defaults when a base URL is needed.
|
||||
- For Gitea `owner/name` input, chooses SSH (the default) or HTTPS transport. SSH uses `GITEA_SSH_USER` (default `git`) and optional `GITEA_SSH_PORT`; HTTPS uses the configured Git credential helper.
|
||||
- Configures remote `origin` to the selected repository URL.
|
||||
- Optionally pushes current branch with upstream tracking (`git push -u origin <branch>`).
|
||||
- Inspects both histories and synchronizes automatically when one side can be fast-forwarded.
|
||||
- If histories diverge, offers merge, replace-local-with-backup, and force-push-with-lease choices.
|
||||
- Requires existing uncommitted changes to be committed or stashed before synchronization.
|
||||
- Repositories with a configured remote expose `Disconnect remote` in the normal operations menu. This removes only the local Git remote configuration.
|
||||
|
||||
## Key Commands in UI
|
||||
|
||||
|
||||
Reference in New Issue
Block a user