Fix Git Flow

This commit is contained in:
2026-08-04 15:53:15 -03:00
parent 8154ca101a
commit 2cdd8c11a3
6 changed files with 720 additions and 62 deletions
+10 -9
View File
@@ -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