pygitgo 1.6.2__tar.gz → 1.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygitgo-1.6.2/src/pygitgo.egg-info → pygitgo-1.7.1}/PKG-INFO +58 -55
- {pygitgo-1.6.2 → pygitgo-1.7.1}/README.md +58 -55
- {pygitgo-1.6.2 → pygitgo-1.7.1}/pyproject.toml +1 -1
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/auth/account.py +18 -10
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/auth/manager.py +31 -10
- pygitgo-1.7.1/src/pygitgo/auth/ssh_utils.py +140 -0
- pygitgo-1.7.1/src/pygitgo/commands/config.py +27 -0
- pygitgo-1.7.1/src/pygitgo/commands/git_branch.py +55 -0
- pygitgo-1.7.1/src/pygitgo/commands/git_core.py +78 -0
- pygitgo-1.7.1/src/pygitgo/commands/git_remote.py +67 -0
- pygitgo-1.7.1/src/pygitgo/commands/jump.py +159 -0
- pygitgo-1.7.1/src/pygitgo/commands/link.py +110 -0
- pygitgo-1.7.1/src/pygitgo/commands/pull.py +75 -0
- pygitgo-1.7.1/src/pygitgo/commands/push.py +155 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/commands/staging.py +5 -6
- pygitgo-1.7.1/src/pygitgo/commands/stash.py +69 -0
- pygitgo-1.7.1/src/pygitgo/commands/state.py +236 -0
- pygitgo-1.7.1/src/pygitgo/commands/undo.py +114 -0
- pygitgo-1.7.1/src/pygitgo/commands/user.py +35 -0
- pygitgo-1.7.1/src/pygitgo/main.py +196 -0
- pygitgo-1.6.2/src/pygitgo/utils/setup.py → pygitgo-1.7.1/src/pygitgo/utils/bootstrap.py +1 -2
- pygitgo-1.7.1/src/pygitgo/utils/colors.py +34 -0
- pygitgo-1.7.1/src/pygitgo/utils/config.py +44 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/utils/executor.py +11 -24
- pygitgo-1.7.1/src/pygitgo/utils/platform.py +27 -0
- pygitgo-1.7.1/src/pygitgo/utils/validators.py +10 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1/src/pygitgo.egg-info}/PKG-INFO +58 -55
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo.egg-info/SOURCES.txt +25 -8
- pygitgo-1.7.1/tests/test_account.py +74 -0
- pygitgo-1.6.2/tests/test_setup.py → pygitgo-1.7.1/tests/test_bootstrap.py +15 -16
- pygitgo-1.7.1/tests/test_config_command.py +46 -0
- pygitgo-1.7.1/tests/test_config_utils.py +104 -0
- pygitgo-1.7.1/tests/test_git_branch.py +103 -0
- pygitgo-1.7.1/tests/test_git_core.py +172 -0
- pygitgo-1.7.1/tests/test_git_remote.py +195 -0
- pygitgo-1.7.1/tests/test_jump.py +257 -0
- pygitgo-1.7.1/tests/test_link.py +106 -0
- pygitgo-1.7.1/tests/test_manager.py +79 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/tests/test_platform.py +3 -3
- {pygitgo-1.6.2 → pygitgo-1.7.1}/tests/test_pull.py +64 -4
- pygitgo-1.7.1/tests/test_push.py +176 -0
- pygitgo-1.7.1/tests/test_ssh_utils.py +120 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/tests/test_staging.py +2 -1
- pygitgo-1.7.1/tests/test_stash.py +151 -0
- pygitgo-1.7.1/tests/test_state.py +226 -0
- pygitgo-1.7.1/tests/test_undo.py +172 -0
- pygitgo-1.7.1/tests/test_user.py +55 -0
- pygitgo-1.6.2/tests/test_main.py → pygitgo-1.7.1/tests/test_validators.py +9 -8
- pygitgo-1.6.2/src/pygitgo/auth/ssh_utils.py +0 -119
- pygitgo-1.6.2/src/pygitgo/commands/git_operations.py +0 -181
- pygitgo-1.6.2/src/pygitgo/commands/jump.py +0 -108
- pygitgo-1.6.2/src/pygitgo/commands/pull.py +0 -45
- pygitgo-1.6.2/src/pygitgo/commands/state.py +0 -175
- pygitgo-1.6.2/src/pygitgo/commands/undo.py +0 -48
- pygitgo-1.6.2/src/pygitgo/main.py +0 -368
- pygitgo-1.6.2/src/pygitgo/utils/colors.py +0 -22
- pygitgo-1.6.2/src/pygitgo/utils/config.py +0 -56
- pygitgo-1.6.2/src/pygitgo/utils/platform_utils.py +0 -172
- pygitgo-1.6.2/tests/test_config.py +0 -99
- pygitgo-1.6.2/tests/test_git_operations.py +0 -471
- pygitgo-1.6.2/tests/test_jump.py +0 -273
- pygitgo-1.6.2/tests/test_state.py +0 -216
- pygitgo-1.6.2/tests/test_undo.py +0 -85
- pygitgo-1.6.2/tests/test_url_validator.py +0 -42
- {pygitgo-1.6.2 → pygitgo-1.7.1}/LICENSE +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/setup.cfg +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/auth/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/commands/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/exceptions.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/utils/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo/utils/update_checker.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo.egg-info/dependency_links.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo.egg-info/entry_points.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo.egg-info/requires.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/src/pygitgo.egg-info/top_level.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.1}/tests/test_update_checker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygitgo
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.1
|
|
4
4
|
Summary: GitGo CLI - Your Fast Git Companion. Simplifies git push, link, stash, and user management.
|
|
5
5
|
Author: Huerte
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -51,7 +51,7 @@ If GitGo saves you time, consider buying me a coffee. It helps keep the project
|
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
-
GitGo wraps your most
|
|
54
|
+
GitGo wraps your most-typed git commands into shorter ones. It covers init, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, and a named stash interface called state management.
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
# Instead of this:
|
|
@@ -87,18 +87,16 @@ gitgo link https://github.com/username/repo.git "init"
|
|
|
87
87
|
|
|
88
88
|
## Features
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- **
|
|
94
|
-
- **
|
|
95
|
-
- **
|
|
96
|
-
- **
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
99
|
-
- **
|
|
100
|
-
- **HTTPS to SSH Conversion:** Silently converts the remote to SSH before pushing if your SSH is configured.
|
|
101
|
-
- **Termux Compatibility:** Works on Android via Termux, handling common issues like dubious ownership errors out of the box.
|
|
90
|
+
- **Single commands for linking, pushing, and stashing.** No more chaining five commands together.
|
|
91
|
+
- **Undo:** Roll back commits, unstage files, discard local changes, or revert pushes. The subcommands say what they do: `undo commit`, `undo add`, `undo changes`, `undo link`, `undo push`.
|
|
92
|
+
- **Branch switching with `jump`:** Stashes your uncommitted work, moves to the target branch, syncs with main, and pops the stash. If a merge conflict occurs, the Try-and-Revert engine offers to roll the whole operation back.
|
|
93
|
+
- **State management:** Named, indexed stash. Run `state list` to see what you saved. No more `stash@{2}` archaeology.
|
|
94
|
+
- **Custom defaults:** Store your preferred branch name and default commit message. GitGo picks them up on every run.
|
|
95
|
+
- **Auto-update checker:** Checks PyPI for newer versions in a background thread. Results are cached for 7 days so startup isn't delayed.
|
|
96
|
+
- **SSH auto-setup & signing:** Generates an `ed25519` key, loads it into `ssh-agent`, opens your GitHub SSH settings page, and automatically signs all future commits for the verified badge.
|
|
97
|
+
- **HTTPS-to-SSH conversion:** Detects HTTPS remotes and rewrites them before pushing if SSH is configured. No manual `git remote set-url`.
|
|
98
|
+
- **Termux support:** Detects the Termux environment, adjusts install paths, uses `termux-open` for browser actions, and patches the dubious ownership Git error.
|
|
99
|
+
- **Safe interruptions:** Hitting `Ctrl+C` midway through a command automatically aborts in-progress merges, cleans up partial states, and tells you exactly what was and wasn't saved.
|
|
102
100
|
|
|
103
101
|
---
|
|
104
102
|
|
|
@@ -113,32 +111,28 @@ No chained commands, no cryptic flags — just short commands you can actually r
|
|
|
113
111
|
|
|
114
112
|
### Install from PyPI
|
|
115
113
|
|
|
116
|
-
For Windows users or environments without global pip restrictions
|
|
114
|
+
For Windows users or environments without global pip restrictions:
|
|
117
115
|
|
|
118
116
|
```bash
|
|
119
117
|
pip install pygitgo
|
|
120
118
|
```
|
|
121
119
|
|
|
122
|
-
*(Alternatively,
|
|
120
|
+
*(Alternatively, use `pipx install pygitgo` for an isolated environment.)*
|
|
123
121
|
|
|
124
122
|
### Install via pipx (Cross-Platform)
|
|
125
123
|
|
|
126
|
-
If you already have `pipx` installed, you can use it to safely install GitGo on any operating system:
|
|
127
|
-
|
|
128
124
|
```bash
|
|
129
125
|
pipx install pygitgo
|
|
130
126
|
```
|
|
131
127
|
|
|
132
128
|
### Quick Install (Linux & macOS)
|
|
133
129
|
|
|
134
|
-
The
|
|
130
|
+
The install script creates an isolated environment and places `gitgo` in `~/.local/bin`. Useful for PEP 668-enforced systems:
|
|
135
131
|
|
|
136
132
|
```bash
|
|
137
133
|
curl -sSL https://raw.githubusercontent.com/Huerte/GitGo/main/install.sh | bash
|
|
138
134
|
```
|
|
139
135
|
|
|
140
|
-
This will automatically create an isolated environment and place `gitgo` in your `~/.local/bin` folder.
|
|
141
|
-
|
|
142
136
|
Verify the installation:
|
|
143
137
|
|
|
144
138
|
```bash
|
|
@@ -160,18 +154,23 @@ pip install -e .
|
|
|
160
154
|
## Usage
|
|
161
155
|
|
|
162
156
|
### 1. Set Up Your Identity
|
|
163
|
-
|
|
157
|
+
|
|
158
|
+
Run this once on a new machine. GitGo generates an SSH key, adds it to `ssh-agent`, prints the public key, and opens your GitHub SSH settings page so you can add it for both authentication and commit signing.
|
|
159
|
+
|
|
164
160
|
```bash
|
|
165
161
|
gitgo user login
|
|
166
162
|
```
|
|
167
163
|
|
|
168
164
|
### 2. Link a New Project to GitHub
|
|
169
|
-
|
|
165
|
+
|
|
166
|
+
Point GitGo at an existing empty GitHub repo. It initializes Git, stages everything, commits, and pushes — including pulling unrelated histories if the remote isn't empty.
|
|
167
|
+
|
|
170
168
|
```bash
|
|
171
169
|
gitgo link https://github.com/username/repo.git "Initial commit"
|
|
172
170
|
```
|
|
173
171
|
|
|
174
172
|
### 3. Push Changes
|
|
173
|
+
|
|
175
174
|
```bash
|
|
176
175
|
# Push to an existing branch
|
|
177
176
|
gitgo push main "Fix auth bug"
|
|
@@ -180,29 +179,36 @@ gitgo push main "Fix auth bug"
|
|
|
180
179
|
gitgo push -n feat/login "Add login flow"
|
|
181
180
|
```
|
|
182
181
|
|
|
183
|
-
### 4.
|
|
184
|
-
|
|
182
|
+
### 4. Switch Branches
|
|
183
|
+
|
|
184
|
+
Switch branches with uncommitted work in progress. `jump` stashes your changes, moves to the target branch, syncs with main, and pops the stash. If the pop triggers a conflict, it offers to abort and restore the repo to its prior state.
|
|
185
|
+
|
|
185
186
|
```bash
|
|
186
187
|
gitgo jump feat/new-login
|
|
187
188
|
```
|
|
188
189
|
|
|
189
|
-
### 5.
|
|
190
|
-
|
|
190
|
+
### 5. Undo Mistakes
|
|
191
|
+
|
|
192
|
+
Undo recent mistakes with commands named for what they undo.
|
|
193
|
+
|
|
191
194
|
```bash
|
|
192
|
-
gitgo undo commit # Undo the last commit (files stay
|
|
193
|
-
gitgo undo add #
|
|
194
|
-
gitgo undo changes # DANGER: permanently
|
|
195
|
+
gitgo undo commit # Undo the last commit (files stay staged)
|
|
196
|
+
gitgo undo add # Unstage files
|
|
197
|
+
gitgo undo changes # DANGER: permanently discard all uncommitted edits
|
|
198
|
+
gitgo undo link # Remove remote and undo initial commit
|
|
199
|
+
gitgo undo push # DANGER: Revert last push with a force-push
|
|
195
200
|
```
|
|
196
201
|
|
|
197
202
|
### 6. Save Your Work-in-Progress
|
|
203
|
+
|
|
198
204
|
```bash
|
|
199
205
|
gitgo state save "halfway through refactor"
|
|
200
206
|
gitgo state list
|
|
201
207
|
gitgo state load 1
|
|
202
208
|
```
|
|
203
209
|
|
|
204
|
-
###
|
|
205
|
-
|
|
210
|
+
### 7. Custom Defaults
|
|
211
|
+
|
|
206
212
|
```bash
|
|
207
213
|
gitgo config set default-branch develop
|
|
208
214
|
gitgo config set default-message "WIP: updates"
|
|
@@ -215,7 +221,7 @@ gitgo config get default-branch
|
|
|
215
221
|
|
|
216
222
|
### `gitgo push`
|
|
217
223
|
|
|
218
|
-
|
|
224
|
+
Stage, commit, and push in one command.
|
|
219
225
|
|
|
220
226
|
```bash
|
|
221
227
|
gitgo push [branch] [message]
|
|
@@ -229,22 +235,22 @@ gitgo push -s [branch] [message] # interactively select files to stage
|
|
|
229
235
|
| Flag | Description |
|
|
230
236
|
|------|-------------|
|
|
231
237
|
| `-n`, `--new` | Create a new branch before pushing |
|
|
232
|
-
| `-s`, `--select` | Interactively select which files
|
|
238
|
+
| `-s`, `--select` | Interactively select which files to include in the push |
|
|
233
239
|
|
|
234
240
|
If there are no new changes but unpushed commits exist, GitGo detects this and pushes without creating an empty commit.
|
|
235
241
|
|
|
236
242
|
### `gitgo pull`
|
|
237
243
|
|
|
238
|
-
|
|
244
|
+
Pulls updates from the remote. Stashes any uncommitted work first, runs a rebase pull, then pops the stash.
|
|
239
245
|
|
|
240
246
|
```bash
|
|
241
|
-
gitgo pull #
|
|
242
|
-
gitgo pull <branch> #
|
|
247
|
+
gitgo pull # Pull updates for the current branch
|
|
248
|
+
gitgo pull <branch> # Pull updates from a specific branch
|
|
243
249
|
```
|
|
244
250
|
|
|
245
251
|
### `gitgo link`
|
|
246
252
|
|
|
247
|
-
Initializes a Git repository
|
|
253
|
+
Initializes a Git repository, connects it to a remote, and pushes. Works on already-initialized repos and handles unrelated histories.
|
|
248
254
|
|
|
249
255
|
```bash
|
|
250
256
|
gitgo link <github_repo_url> [commit_message]
|
|
@@ -252,7 +258,7 @@ gitgo link <github_repo_url> [commit_message]
|
|
|
252
258
|
|
|
253
259
|
### `gitgo jump`
|
|
254
260
|
|
|
255
|
-
|
|
261
|
+
Switches branches with uncommitted work in progress. Stashes changes, moves to the target branch, pulls from main, and pops the stash. If the pop triggers a merge conflict, the Try-and-Revert engine offers to abort the entire operation and restore the repo to the state it was in before the command ran.
|
|
256
262
|
|
|
257
263
|
```bash
|
|
258
264
|
gitgo jump <branch>
|
|
@@ -260,17 +266,19 @@ gitgo jump <branch>
|
|
|
260
266
|
|
|
261
267
|
### `gitgo undo`
|
|
262
268
|
|
|
263
|
-
|
|
269
|
+
Undo recent actions with subcommands named for what they undo.
|
|
264
270
|
|
|
265
271
|
```bash
|
|
266
|
-
gitgo undo commit # Undo
|
|
267
|
-
gitgo undo add #
|
|
268
|
-
gitgo undo changes # Permanently
|
|
272
|
+
gitgo undo commit # Undo the last commit without losing files
|
|
273
|
+
gitgo undo add # Unstage files
|
|
274
|
+
gitgo undo changes # Permanently discard all new files and uncommitted edits
|
|
275
|
+
gitgo undo link # Remove the remote and undo the initial commit
|
|
276
|
+
gitgo undo push # DANGER: Revert the last push with a force-push
|
|
269
277
|
```
|
|
270
278
|
|
|
271
279
|
### `gitgo state`
|
|
272
280
|
|
|
273
|
-
|
|
281
|
+
Named, indexed interface over `git stash`.
|
|
274
282
|
|
|
275
283
|
```bash
|
|
276
284
|
gitgo state list # show all saved states
|
|
@@ -279,6 +287,7 @@ gitgo state load [id] # restore a state by index
|
|
|
279
287
|
gitgo state delete [id] # delete a state by index
|
|
280
288
|
gitgo state delete -a # delete all saved states
|
|
281
289
|
```
|
|
290
|
+
|
|
282
291
|
*Short aliases:* `-l`, `-s`, `-o`, `-d`
|
|
283
292
|
|
|
284
293
|
### `gitgo user`
|
|
@@ -316,19 +325,17 @@ gitgo -r # verify GitGo is ready
|
|
|
316
325
|
|
|
317
326
|
## How It Works
|
|
318
327
|
|
|
319
|
-
- **SSH Auto-Setup:** `gitgo user login` generates an `ed25519` SSH key
|
|
320
|
-
- **HTTPS to SSH Conversion:** If your remote is set to HTTPS, GitGo
|
|
328
|
+
- **SSH Auto-Setup & Signing:** `gitgo user login` generates an `ed25519` SSH key and prompts you to add it to GitHub twice (for authentication and signing). GitGo then injects temporary `-c` flags into every commit to automatically sign them with this key, without touching your global git config.
|
|
329
|
+
- **HTTPS to SSH Conversion:** If your remote is set to HTTPS and SSH is configured, GitGo rewrites the remote before pushing. No `git remote set-url` required.
|
|
321
330
|
- **Auto-Update Checker:** Spawns a non-blocking background thread on startup to query PyPI for newer versions. Results are cached locally for 7 days to prevent unnecessary network requests.
|
|
322
|
-
- **Termux Compatibility:** Detects Termux via environment variables, adjusts binary locations (`$PREFIX/bin`), uses `termux-open` for browser actions, and
|
|
331
|
+
- **Termux Compatibility:** Detects Termux via environment variables, adjusts binary locations (`$PREFIX/bin`), uses `termux-open` for browser actions, and patches the `detected dubious ownership` Git error.
|
|
323
332
|
- **State Management:** `gitgo state` wraps `git stash` with named saves, indexed listing, and confirmation prompts.
|
|
324
333
|
|
|
325
334
|
---
|
|
326
335
|
|
|
327
336
|
## Contributing
|
|
328
337
|
|
|
329
|
-
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide,
|
|
330
|
-
including project structure, test instructions, commit conventions, and a
|
|
331
|
-
[Good First Issues](CONTRIBUTING.md#good-first-issues) table if you are not sure where to start.
|
|
338
|
+
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide, including project structure, test instructions, commit conventions, and a [Good First Issues](CONTRIBUTING.md#good-first-issues) table if you're not sure where to start.
|
|
332
339
|
|
|
333
340
|
---
|
|
334
341
|
|
|
@@ -338,7 +345,7 @@ including project structure, test instructions, commit conventions, and a
|
|
|
338
345
|
<table>
|
|
339
346
|
<tr>
|
|
340
347
|
<td align="center"><a href="https://github.com/Huerte"><img src="https://github.com/Huerte.png" width="80px;" alt=""/></a><br /><a href="https://github.com/Huerte"><b>Huerte</b></a><br />Creator</td>
|
|
341
|
-
<td align="center"><a href="https://github.com/Venomous-pie"><img src="https://github.com/Venomous-pie.png" width="80px;" alt=""/></a><br /><a href="https://github.com/Venomous-pie"><b>Venomous-pie</b></a><br />
|
|
348
|
+
<td align="center"><a href="https://github.com/Venomous-pie"><img src="https://github.com/Venomous-pie.png" width="80px;" alt=""/></a><br /><a href="https://github.com/Venomous-pie"><b>Venomous-pie</b></a><br />Contributor</td>
|
|
342
349
|
</tr>
|
|
343
350
|
</table>
|
|
344
351
|
</div>
|
|
@@ -350,7 +357,3 @@ including project structure, test instructions, commit conventions, and a
|
|
|
350
357
|
Distributed under the **GPLv3** License. See [`LICENSE`](LICENSE) for details.
|
|
351
358
|
|
|
352
359
|
---
|
|
353
|
-
|
|
354
|
-
<div align="center">
|
|
355
|
-
<sub>Created by <a href="https://github.com/Huerte">Huerte</a> with core contributions from <a href="https://github.com/Venomous-pie">Venomous-pie</a></sub>
|
|
356
|
-
</div>
|
|
@@ -26,7 +26,7 @@ If GitGo saves you time, consider buying me a coffee. It helps keep the project
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
GitGo wraps your most
|
|
29
|
+
GitGo wraps your most-typed git commands into shorter ones. It covers init, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, and a named stash interface called state management.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
# Instead of this:
|
|
@@ -62,18 +62,16 @@ gitgo link https://github.com/username/repo.git "init"
|
|
|
62
62
|
|
|
63
63
|
## Features
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
70
|
-
- **
|
|
71
|
-
- **
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **HTTPS to SSH Conversion:** Silently converts the remote to SSH before pushing if your SSH is configured.
|
|
76
|
-
- **Termux Compatibility:** Works on Android via Termux, handling common issues like dubious ownership errors out of the box.
|
|
65
|
+
- **Single commands for linking, pushing, and stashing.** No more chaining five commands together.
|
|
66
|
+
- **Undo:** Roll back commits, unstage files, discard local changes, or revert pushes. The subcommands say what they do: `undo commit`, `undo add`, `undo changes`, `undo link`, `undo push`.
|
|
67
|
+
- **Branch switching with `jump`:** Stashes your uncommitted work, moves to the target branch, syncs with main, and pops the stash. If a merge conflict occurs, the Try-and-Revert engine offers to roll the whole operation back.
|
|
68
|
+
- **State management:** Named, indexed stash. Run `state list` to see what you saved. No more `stash@{2}` archaeology.
|
|
69
|
+
- **Custom defaults:** Store your preferred branch name and default commit message. GitGo picks them up on every run.
|
|
70
|
+
- **Auto-update checker:** Checks PyPI for newer versions in a background thread. Results are cached for 7 days so startup isn't delayed.
|
|
71
|
+
- **SSH auto-setup & signing:** Generates an `ed25519` key, loads it into `ssh-agent`, opens your GitHub SSH settings page, and automatically signs all future commits for the verified badge.
|
|
72
|
+
- **HTTPS-to-SSH conversion:** Detects HTTPS remotes and rewrites them before pushing if SSH is configured. No manual `git remote set-url`.
|
|
73
|
+
- **Termux support:** Detects the Termux environment, adjusts install paths, uses `termux-open` for browser actions, and patches the dubious ownership Git error.
|
|
74
|
+
- **Safe interruptions:** Hitting `Ctrl+C` midway through a command automatically aborts in-progress merges, cleans up partial states, and tells you exactly what was and wasn't saved.
|
|
77
75
|
|
|
78
76
|
---
|
|
79
77
|
|
|
@@ -88,32 +86,28 @@ No chained commands, no cryptic flags — just short commands you can actually r
|
|
|
88
86
|
|
|
89
87
|
### Install from PyPI
|
|
90
88
|
|
|
91
|
-
For Windows users or environments without global pip restrictions
|
|
89
|
+
For Windows users or environments without global pip restrictions:
|
|
92
90
|
|
|
93
91
|
```bash
|
|
94
92
|
pip install pygitgo
|
|
95
93
|
```
|
|
96
94
|
|
|
97
|
-
*(Alternatively,
|
|
95
|
+
*(Alternatively, use `pipx install pygitgo` for an isolated environment.)*
|
|
98
96
|
|
|
99
97
|
### Install via pipx (Cross-Platform)
|
|
100
98
|
|
|
101
|
-
If you already have `pipx` installed, you can use it to safely install GitGo on any operating system:
|
|
102
|
-
|
|
103
99
|
```bash
|
|
104
100
|
pipx install pygitgo
|
|
105
101
|
```
|
|
106
102
|
|
|
107
103
|
### Quick Install (Linux & macOS)
|
|
108
104
|
|
|
109
|
-
The
|
|
105
|
+
The install script creates an isolated environment and places `gitgo` in `~/.local/bin`. Useful for PEP 668-enforced systems:
|
|
110
106
|
|
|
111
107
|
```bash
|
|
112
108
|
curl -sSL https://raw.githubusercontent.com/Huerte/GitGo/main/install.sh | bash
|
|
113
109
|
```
|
|
114
110
|
|
|
115
|
-
This will automatically create an isolated environment and place `gitgo` in your `~/.local/bin` folder.
|
|
116
|
-
|
|
117
111
|
Verify the installation:
|
|
118
112
|
|
|
119
113
|
```bash
|
|
@@ -135,18 +129,23 @@ pip install -e .
|
|
|
135
129
|
## Usage
|
|
136
130
|
|
|
137
131
|
### 1. Set Up Your Identity
|
|
138
|
-
|
|
132
|
+
|
|
133
|
+
Run this once on a new machine. GitGo generates an SSH key, adds it to `ssh-agent`, prints the public key, and opens your GitHub SSH settings page so you can add it for both authentication and commit signing.
|
|
134
|
+
|
|
139
135
|
```bash
|
|
140
136
|
gitgo user login
|
|
141
137
|
```
|
|
142
138
|
|
|
143
139
|
### 2. Link a New Project to GitHub
|
|
144
|
-
|
|
140
|
+
|
|
141
|
+
Point GitGo at an existing empty GitHub repo. It initializes Git, stages everything, commits, and pushes — including pulling unrelated histories if the remote isn't empty.
|
|
142
|
+
|
|
145
143
|
```bash
|
|
146
144
|
gitgo link https://github.com/username/repo.git "Initial commit"
|
|
147
145
|
```
|
|
148
146
|
|
|
149
147
|
### 3. Push Changes
|
|
148
|
+
|
|
150
149
|
```bash
|
|
151
150
|
# Push to an existing branch
|
|
152
151
|
gitgo push main "Fix auth bug"
|
|
@@ -155,29 +154,36 @@ gitgo push main "Fix auth bug"
|
|
|
155
154
|
gitgo push -n feat/login "Add login flow"
|
|
156
155
|
```
|
|
157
156
|
|
|
158
|
-
### 4.
|
|
159
|
-
|
|
157
|
+
### 4. Switch Branches
|
|
158
|
+
|
|
159
|
+
Switch branches with uncommitted work in progress. `jump` stashes your changes, moves to the target branch, syncs with main, and pops the stash. If the pop triggers a conflict, it offers to abort and restore the repo to its prior state.
|
|
160
|
+
|
|
160
161
|
```bash
|
|
161
162
|
gitgo jump feat/new-login
|
|
162
163
|
```
|
|
163
164
|
|
|
164
|
-
### 5.
|
|
165
|
-
|
|
165
|
+
### 5. Undo Mistakes
|
|
166
|
+
|
|
167
|
+
Undo recent mistakes with commands named for what they undo.
|
|
168
|
+
|
|
166
169
|
```bash
|
|
167
|
-
gitgo undo commit # Undo the last commit (files stay
|
|
168
|
-
gitgo undo add #
|
|
169
|
-
gitgo undo changes # DANGER: permanently
|
|
170
|
+
gitgo undo commit # Undo the last commit (files stay staged)
|
|
171
|
+
gitgo undo add # Unstage files
|
|
172
|
+
gitgo undo changes # DANGER: permanently discard all uncommitted edits
|
|
173
|
+
gitgo undo link # Remove remote and undo initial commit
|
|
174
|
+
gitgo undo push # DANGER: Revert last push with a force-push
|
|
170
175
|
```
|
|
171
176
|
|
|
172
177
|
### 6. Save Your Work-in-Progress
|
|
178
|
+
|
|
173
179
|
```bash
|
|
174
180
|
gitgo state save "halfway through refactor"
|
|
175
181
|
gitgo state list
|
|
176
182
|
gitgo state load 1
|
|
177
183
|
```
|
|
178
184
|
|
|
179
|
-
###
|
|
180
|
-
|
|
185
|
+
### 7. Custom Defaults
|
|
186
|
+
|
|
181
187
|
```bash
|
|
182
188
|
gitgo config set default-branch develop
|
|
183
189
|
gitgo config set default-message "WIP: updates"
|
|
@@ -190,7 +196,7 @@ gitgo config get default-branch
|
|
|
190
196
|
|
|
191
197
|
### `gitgo push`
|
|
192
198
|
|
|
193
|
-
|
|
199
|
+
Stage, commit, and push in one command.
|
|
194
200
|
|
|
195
201
|
```bash
|
|
196
202
|
gitgo push [branch] [message]
|
|
@@ -204,22 +210,22 @@ gitgo push -s [branch] [message] # interactively select files to stage
|
|
|
204
210
|
| Flag | Description |
|
|
205
211
|
|------|-------------|
|
|
206
212
|
| `-n`, `--new` | Create a new branch before pushing |
|
|
207
|
-
| `-s`, `--select` | Interactively select which files
|
|
213
|
+
| `-s`, `--select` | Interactively select which files to include in the push |
|
|
208
214
|
|
|
209
215
|
If there are no new changes but unpushed commits exist, GitGo detects this and pushes without creating an empty commit.
|
|
210
216
|
|
|
211
217
|
### `gitgo pull`
|
|
212
218
|
|
|
213
|
-
|
|
219
|
+
Pulls updates from the remote. Stashes any uncommitted work first, runs a rebase pull, then pops the stash.
|
|
214
220
|
|
|
215
221
|
```bash
|
|
216
|
-
gitgo pull #
|
|
217
|
-
gitgo pull <branch> #
|
|
222
|
+
gitgo pull # Pull updates for the current branch
|
|
223
|
+
gitgo pull <branch> # Pull updates from a specific branch
|
|
218
224
|
```
|
|
219
225
|
|
|
220
226
|
### `gitgo link`
|
|
221
227
|
|
|
222
|
-
Initializes a Git repository
|
|
228
|
+
Initializes a Git repository, connects it to a remote, and pushes. Works on already-initialized repos and handles unrelated histories.
|
|
223
229
|
|
|
224
230
|
```bash
|
|
225
231
|
gitgo link <github_repo_url> [commit_message]
|
|
@@ -227,7 +233,7 @@ gitgo link <github_repo_url> [commit_message]
|
|
|
227
233
|
|
|
228
234
|
### `gitgo jump`
|
|
229
235
|
|
|
230
|
-
|
|
236
|
+
Switches branches with uncommitted work in progress. Stashes changes, moves to the target branch, pulls from main, and pops the stash. If the pop triggers a merge conflict, the Try-and-Revert engine offers to abort the entire operation and restore the repo to the state it was in before the command ran.
|
|
231
237
|
|
|
232
238
|
```bash
|
|
233
239
|
gitgo jump <branch>
|
|
@@ -235,17 +241,19 @@ gitgo jump <branch>
|
|
|
235
241
|
|
|
236
242
|
### `gitgo undo`
|
|
237
243
|
|
|
238
|
-
|
|
244
|
+
Undo recent actions with subcommands named for what they undo.
|
|
239
245
|
|
|
240
246
|
```bash
|
|
241
|
-
gitgo undo commit # Undo
|
|
242
|
-
gitgo undo add #
|
|
243
|
-
gitgo undo changes # Permanently
|
|
247
|
+
gitgo undo commit # Undo the last commit without losing files
|
|
248
|
+
gitgo undo add # Unstage files
|
|
249
|
+
gitgo undo changes # Permanently discard all new files and uncommitted edits
|
|
250
|
+
gitgo undo link # Remove the remote and undo the initial commit
|
|
251
|
+
gitgo undo push # DANGER: Revert the last push with a force-push
|
|
244
252
|
```
|
|
245
253
|
|
|
246
254
|
### `gitgo state`
|
|
247
255
|
|
|
248
|
-
|
|
256
|
+
Named, indexed interface over `git stash`.
|
|
249
257
|
|
|
250
258
|
```bash
|
|
251
259
|
gitgo state list # show all saved states
|
|
@@ -254,6 +262,7 @@ gitgo state load [id] # restore a state by index
|
|
|
254
262
|
gitgo state delete [id] # delete a state by index
|
|
255
263
|
gitgo state delete -a # delete all saved states
|
|
256
264
|
```
|
|
265
|
+
|
|
257
266
|
*Short aliases:* `-l`, `-s`, `-o`, `-d`
|
|
258
267
|
|
|
259
268
|
### `gitgo user`
|
|
@@ -291,19 +300,17 @@ gitgo -r # verify GitGo is ready
|
|
|
291
300
|
|
|
292
301
|
## How It Works
|
|
293
302
|
|
|
294
|
-
- **SSH Auto-Setup:** `gitgo user login` generates an `ed25519` SSH key
|
|
295
|
-
- **HTTPS to SSH Conversion:** If your remote is set to HTTPS, GitGo
|
|
303
|
+
- **SSH Auto-Setup & Signing:** `gitgo user login` generates an `ed25519` SSH key and prompts you to add it to GitHub twice (for authentication and signing). GitGo then injects temporary `-c` flags into every commit to automatically sign them with this key, without touching your global git config.
|
|
304
|
+
- **HTTPS to SSH Conversion:** If your remote is set to HTTPS and SSH is configured, GitGo rewrites the remote before pushing. No `git remote set-url` required.
|
|
296
305
|
- **Auto-Update Checker:** Spawns a non-blocking background thread on startup to query PyPI for newer versions. Results are cached locally for 7 days to prevent unnecessary network requests.
|
|
297
|
-
- **Termux Compatibility:** Detects Termux via environment variables, adjusts binary locations (`$PREFIX/bin`), uses `termux-open` for browser actions, and
|
|
306
|
+
- **Termux Compatibility:** Detects Termux via environment variables, adjusts binary locations (`$PREFIX/bin`), uses `termux-open` for browser actions, and patches the `detected dubious ownership` Git error.
|
|
298
307
|
- **State Management:** `gitgo state` wraps `git stash` with named saves, indexed listing, and confirmation prompts.
|
|
299
308
|
|
|
300
309
|
---
|
|
301
310
|
|
|
302
311
|
## Contributing
|
|
303
312
|
|
|
304
|
-
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide,
|
|
305
|
-
including project structure, test instructions, commit conventions, and a
|
|
306
|
-
[Good First Issues](CONTRIBUTING.md#good-first-issues) table if you are not sure where to start.
|
|
313
|
+
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide, including project structure, test instructions, commit conventions, and a [Good First Issues](CONTRIBUTING.md#good-first-issues) table if you're not sure where to start.
|
|
307
314
|
|
|
308
315
|
---
|
|
309
316
|
|
|
@@ -313,7 +320,7 @@ including project structure, test instructions, commit conventions, and a
|
|
|
313
320
|
<table>
|
|
314
321
|
<tr>
|
|
315
322
|
<td align="center"><a href="https://github.com/Huerte"><img src="https://github.com/Huerte.png" width="80px;" alt=""/></a><br /><a href="https://github.com/Huerte"><b>Huerte</b></a><br />Creator</td>
|
|
316
|
-
<td align="center"><a href="https://github.com/Venomous-pie"><img src="https://github.com/Venomous-pie.png" width="80px;" alt=""/></a><br /><a href="https://github.com/Venomous-pie"><b>Venomous-pie</b></a><br />
|
|
323
|
+
<td align="center"><a href="https://github.com/Venomous-pie"><img src="https://github.com/Venomous-pie.png" width="80px;" alt=""/></a><br /><a href="https://github.com/Venomous-pie"><b>Venomous-pie</b></a><br />Contributor</td>
|
|
317
324
|
</tr>
|
|
318
325
|
</table>
|
|
319
326
|
</div>
|
|
@@ -324,8 +331,4 @@ including project structure, test instructions, commit conventions, and a
|
|
|
324
331
|
|
|
325
332
|
Distributed under the **GPLv3** License. See [`LICENSE`](LICENSE) for details.
|
|
326
333
|
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
<div align="center">
|
|
330
|
-
<sub>Created by <a href="https://github.com/Huerte">Huerte</a> with core contributions from <a href="https://github.com/Venomous-pie">Venomous-pie</a></sub>
|
|
331
|
-
</div>
|
|
334
|
+
---
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pygitgo"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.7.1"
|
|
8
8
|
description = "GitGo CLI - Your Fast Git Companion. Simplifies git push, link, stash, and user management."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "GPL-3.0-or-later"}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
from pygitgo.utils.colors import info, success, warning, error, BLUE, RESET
|
|
2
2
|
from pygitgo.utils.executor import run_command
|
|
3
|
-
import
|
|
3
|
+
from pygitgo.exceptions import GitCommandError
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def get_user():
|
|
7
7
|
try:
|
|
8
|
-
name = run_command(["git", "config", "--global", "user.name"]
|
|
9
|
-
|
|
8
|
+
name = run_command(["git", "config", "--global", "user.name"])
|
|
9
|
+
except GitCommandError:
|
|
10
|
+
name = None
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
email = run_command(["git", "config", "--global", "user.email"])
|
|
14
|
+
except GitCommandError:
|
|
15
|
+
email = None
|
|
16
|
+
|
|
17
|
+
if not name:
|
|
18
|
+
name = None
|
|
19
|
+
if not email:
|
|
20
|
+
email = None
|
|
21
|
+
|
|
22
|
+
return name, email
|
|
10
23
|
|
|
11
|
-
if not name or isinstance(name, subprocess.CalledProcessError):
|
|
12
|
-
name = None
|
|
13
|
-
if not email or isinstance(email, subprocess.CalledProcessError):
|
|
14
|
-
email = None
|
|
15
|
-
return name, email
|
|
16
|
-
except:
|
|
17
|
-
return None, None
|
|
18
24
|
|
|
19
25
|
def set_user(name, email):
|
|
20
26
|
run_command(["git", "config", "--global", "user.name", name])
|
|
@@ -59,3 +65,5 @@ def ensure_user_configure(default_email=None, default_username=None):
|
|
|
59
65
|
|
|
60
66
|
error("Invalid configuration. Name and Email are required.")
|
|
61
67
|
return False
|
|
68
|
+
|
|
69
|
+
|