pygitgo 1.6.2__tar.gz → 1.7.0__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.0}/PKG-INFO +54 -55
- {pygitgo-1.6.2 → pygitgo-1.7.0}/README.md +54 -55
- {pygitgo-1.6.2 → pygitgo-1.7.0}/pyproject.toml +1 -1
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/auth/account.py +18 -10
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/auth/manager.py +31 -10
- pygitgo-1.7.0/src/pygitgo/auth/ssh_utils.py +140 -0
- pygitgo-1.7.0/src/pygitgo/commands/config.py +27 -0
- pygitgo-1.7.0/src/pygitgo/commands/git_branch.py +55 -0
- pygitgo-1.7.0/src/pygitgo/commands/git_core.py +78 -0
- pygitgo-1.7.0/src/pygitgo/commands/git_remote.py +67 -0
- pygitgo-1.7.0/src/pygitgo/commands/jump.py +159 -0
- pygitgo-1.7.0/src/pygitgo/commands/link.py +116 -0
- pygitgo-1.7.0/src/pygitgo/commands/pull.py +75 -0
- pygitgo-1.7.0/src/pygitgo/commands/push.py +153 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/commands/staging.py +5 -6
- pygitgo-1.7.0/src/pygitgo/commands/stash.py +69 -0
- pygitgo-1.7.0/src/pygitgo/commands/state.py +236 -0
- pygitgo-1.7.0/src/pygitgo/commands/undo.py +61 -0
- pygitgo-1.7.0/src/pygitgo/commands/user.py +35 -0
- pygitgo-1.7.0/src/pygitgo/main.py +191 -0
- pygitgo-1.6.2/src/pygitgo/utils/setup.py → pygitgo-1.7.0/src/pygitgo/utils/bootstrap.py +1 -2
- pygitgo-1.7.0/src/pygitgo/utils/colors.py +34 -0
- pygitgo-1.7.0/src/pygitgo/utils/config.py +29 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/utils/executor.py +11 -24
- pygitgo-1.7.0/src/pygitgo/utils/platform.py +27 -0
- pygitgo-1.7.0/src/pygitgo/utils/validators.py +10 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0/src/pygitgo.egg-info}/PKG-INFO +54 -55
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo.egg-info/SOURCES.txt +25 -8
- pygitgo-1.7.0/tests/test_account.py +74 -0
- pygitgo-1.6.2/tests/test_setup.py → pygitgo-1.7.0/tests/test_bootstrap.py +15 -16
- pygitgo-1.7.0/tests/test_config_command.py +46 -0
- pygitgo-1.7.0/tests/test_config_utils.py +57 -0
- pygitgo-1.7.0/tests/test_git_branch.py +103 -0
- pygitgo-1.7.0/tests/test_git_core.py +172 -0
- pygitgo-1.7.0/tests/test_git_remote.py +195 -0
- pygitgo-1.7.0/tests/test_jump.py +257 -0
- pygitgo-1.7.0/tests/test_link.py +106 -0
- pygitgo-1.7.0/tests/test_manager.py +79 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/tests/test_platform.py +3 -3
- {pygitgo-1.6.2 → pygitgo-1.7.0}/tests/test_pull.py +64 -4
- pygitgo-1.7.0/tests/test_push.py +176 -0
- pygitgo-1.7.0/tests/test_ssh_utils.py +120 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/tests/test_staging.py +2 -1
- pygitgo-1.7.0/tests/test_stash.py +151 -0
- pygitgo-1.7.0/tests/test_state.py +226 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/tests/test_undo.py +9 -9
- pygitgo-1.7.0/tests/test_user.py +55 -0
- pygitgo-1.6.2/tests/test_main.py → pygitgo-1.7.0/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_url_validator.py +0 -42
- {pygitgo-1.6.2 → pygitgo-1.7.0}/LICENSE +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/setup.cfg +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/auth/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/commands/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/exceptions.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/utils/__init__.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo/utils/update_checker.py +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo.egg-info/dependency_links.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo.egg-info/entry_points.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo.egg-info/requires.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/src/pygitgo.egg-info/top_level.txt +0 -0
- {pygitgo-1.6.2 → pygitgo-1.7.0}/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.0
|
|
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, or discard local changes. The subcommands say what they do: `undo commit`, `undo add`, `undo changes`.
|
|
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,34 @@ 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
|
|
195
198
|
```
|
|
196
199
|
|
|
197
200
|
### 6. Save Your Work-in-Progress
|
|
201
|
+
|
|
198
202
|
```bash
|
|
199
203
|
gitgo state save "halfway through refactor"
|
|
200
204
|
gitgo state list
|
|
201
205
|
gitgo state load 1
|
|
202
206
|
```
|
|
203
207
|
|
|
204
|
-
###
|
|
205
|
-
|
|
208
|
+
### 7. Custom Defaults
|
|
209
|
+
|
|
206
210
|
```bash
|
|
207
211
|
gitgo config set default-branch develop
|
|
208
212
|
gitgo config set default-message "WIP: updates"
|
|
@@ -215,7 +219,7 @@ gitgo config get default-branch
|
|
|
215
219
|
|
|
216
220
|
### `gitgo push`
|
|
217
221
|
|
|
218
|
-
|
|
222
|
+
Stage, commit, and push in one command.
|
|
219
223
|
|
|
220
224
|
```bash
|
|
221
225
|
gitgo push [branch] [message]
|
|
@@ -229,22 +233,22 @@ gitgo push -s [branch] [message] # interactively select files to stage
|
|
|
229
233
|
| Flag | Description |
|
|
230
234
|
|------|-------------|
|
|
231
235
|
| `-n`, `--new` | Create a new branch before pushing |
|
|
232
|
-
| `-s`, `--select` | Interactively select which files
|
|
236
|
+
| `-s`, `--select` | Interactively select which files to include in the push |
|
|
233
237
|
|
|
234
238
|
If there are no new changes but unpushed commits exist, GitGo detects this and pushes without creating an empty commit.
|
|
235
239
|
|
|
236
240
|
### `gitgo pull`
|
|
237
241
|
|
|
238
|
-
|
|
242
|
+
Pulls updates from the remote. Stashes any uncommitted work first, runs a rebase pull, then pops the stash.
|
|
239
243
|
|
|
240
244
|
```bash
|
|
241
|
-
gitgo pull #
|
|
242
|
-
gitgo pull <branch> #
|
|
245
|
+
gitgo pull # Pull updates for the current branch
|
|
246
|
+
gitgo pull <branch> # Pull updates from a specific branch
|
|
243
247
|
```
|
|
244
248
|
|
|
245
249
|
### `gitgo link`
|
|
246
250
|
|
|
247
|
-
Initializes a Git repository
|
|
251
|
+
Initializes a Git repository, connects it to a remote, and pushes. Works on already-initialized repos and handles unrelated histories.
|
|
248
252
|
|
|
249
253
|
```bash
|
|
250
254
|
gitgo link <github_repo_url> [commit_message]
|
|
@@ -252,7 +256,7 @@ gitgo link <github_repo_url> [commit_message]
|
|
|
252
256
|
|
|
253
257
|
### `gitgo jump`
|
|
254
258
|
|
|
255
|
-
|
|
259
|
+
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
260
|
|
|
257
261
|
```bash
|
|
258
262
|
gitgo jump <branch>
|
|
@@ -260,17 +264,17 @@ gitgo jump <branch>
|
|
|
260
264
|
|
|
261
265
|
### `gitgo undo`
|
|
262
266
|
|
|
263
|
-
|
|
267
|
+
Undo recent actions with subcommands named for what they undo.
|
|
264
268
|
|
|
265
269
|
```bash
|
|
266
|
-
gitgo undo commit # Undo
|
|
267
|
-
gitgo undo add #
|
|
268
|
-
gitgo undo changes # Permanently
|
|
270
|
+
gitgo undo commit # Undo the last commit without losing files
|
|
271
|
+
gitgo undo add # Unstage files
|
|
272
|
+
gitgo undo changes # Permanently discard all new files and uncommitted edits
|
|
269
273
|
```
|
|
270
274
|
|
|
271
275
|
### `gitgo state`
|
|
272
276
|
|
|
273
|
-
|
|
277
|
+
Named, indexed interface over `git stash`.
|
|
274
278
|
|
|
275
279
|
```bash
|
|
276
280
|
gitgo state list # show all saved states
|
|
@@ -279,6 +283,7 @@ gitgo state load [id] # restore a state by index
|
|
|
279
283
|
gitgo state delete [id] # delete a state by index
|
|
280
284
|
gitgo state delete -a # delete all saved states
|
|
281
285
|
```
|
|
286
|
+
|
|
282
287
|
*Short aliases:* `-l`, `-s`, `-o`, `-d`
|
|
283
288
|
|
|
284
289
|
### `gitgo user`
|
|
@@ -316,19 +321,17 @@ gitgo -r # verify GitGo is ready
|
|
|
316
321
|
|
|
317
322
|
## How It Works
|
|
318
323
|
|
|
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
|
|
324
|
+
- **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.
|
|
325
|
+
- **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
326
|
- **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
|
|
327
|
+
- **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
328
|
- **State Management:** `gitgo state` wraps `git stash` with named saves, indexed listing, and confirmation prompts.
|
|
324
329
|
|
|
325
330
|
---
|
|
326
331
|
|
|
327
332
|
## Contributing
|
|
328
333
|
|
|
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.
|
|
334
|
+
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
335
|
|
|
333
336
|
---
|
|
334
337
|
|
|
@@ -338,7 +341,7 @@ including project structure, test instructions, commit conventions, and a
|
|
|
338
341
|
<table>
|
|
339
342
|
<tr>
|
|
340
343
|
<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 />
|
|
344
|
+
<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
345
|
</tr>
|
|
343
346
|
</table>
|
|
344
347
|
</div>
|
|
@@ -350,7 +353,3 @@ including project structure, test instructions, commit conventions, and a
|
|
|
350
353
|
Distributed under the **GPLv3** License. See [`LICENSE`](LICENSE) for details.
|
|
351
354
|
|
|
352
355
|
---
|
|
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, or discard local changes. The subcommands say what they do: `undo commit`, `undo add`, `undo changes`.
|
|
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,34 @@ 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
|
|
170
173
|
```
|
|
171
174
|
|
|
172
175
|
### 6. Save Your Work-in-Progress
|
|
176
|
+
|
|
173
177
|
```bash
|
|
174
178
|
gitgo state save "halfway through refactor"
|
|
175
179
|
gitgo state list
|
|
176
180
|
gitgo state load 1
|
|
177
181
|
```
|
|
178
182
|
|
|
179
|
-
###
|
|
180
|
-
|
|
183
|
+
### 7. Custom Defaults
|
|
184
|
+
|
|
181
185
|
```bash
|
|
182
186
|
gitgo config set default-branch develop
|
|
183
187
|
gitgo config set default-message "WIP: updates"
|
|
@@ -190,7 +194,7 @@ gitgo config get default-branch
|
|
|
190
194
|
|
|
191
195
|
### `gitgo push`
|
|
192
196
|
|
|
193
|
-
|
|
197
|
+
Stage, commit, and push in one command.
|
|
194
198
|
|
|
195
199
|
```bash
|
|
196
200
|
gitgo push [branch] [message]
|
|
@@ -204,22 +208,22 @@ gitgo push -s [branch] [message] # interactively select files to stage
|
|
|
204
208
|
| Flag | Description |
|
|
205
209
|
|------|-------------|
|
|
206
210
|
| `-n`, `--new` | Create a new branch before pushing |
|
|
207
|
-
| `-s`, `--select` | Interactively select which files
|
|
211
|
+
| `-s`, `--select` | Interactively select which files to include in the push |
|
|
208
212
|
|
|
209
213
|
If there are no new changes but unpushed commits exist, GitGo detects this and pushes without creating an empty commit.
|
|
210
214
|
|
|
211
215
|
### `gitgo pull`
|
|
212
216
|
|
|
213
|
-
|
|
217
|
+
Pulls updates from the remote. Stashes any uncommitted work first, runs a rebase pull, then pops the stash.
|
|
214
218
|
|
|
215
219
|
```bash
|
|
216
|
-
gitgo pull #
|
|
217
|
-
gitgo pull <branch> #
|
|
220
|
+
gitgo pull # Pull updates for the current branch
|
|
221
|
+
gitgo pull <branch> # Pull updates from a specific branch
|
|
218
222
|
```
|
|
219
223
|
|
|
220
224
|
### `gitgo link`
|
|
221
225
|
|
|
222
|
-
Initializes a Git repository
|
|
226
|
+
Initializes a Git repository, connects it to a remote, and pushes. Works on already-initialized repos and handles unrelated histories.
|
|
223
227
|
|
|
224
228
|
```bash
|
|
225
229
|
gitgo link <github_repo_url> [commit_message]
|
|
@@ -227,7 +231,7 @@ gitgo link <github_repo_url> [commit_message]
|
|
|
227
231
|
|
|
228
232
|
### `gitgo jump`
|
|
229
233
|
|
|
230
|
-
|
|
234
|
+
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
235
|
|
|
232
236
|
```bash
|
|
233
237
|
gitgo jump <branch>
|
|
@@ -235,17 +239,17 @@ gitgo jump <branch>
|
|
|
235
239
|
|
|
236
240
|
### `gitgo undo`
|
|
237
241
|
|
|
238
|
-
|
|
242
|
+
Undo recent actions with subcommands named for what they undo.
|
|
239
243
|
|
|
240
244
|
```bash
|
|
241
|
-
gitgo undo commit # Undo
|
|
242
|
-
gitgo undo add #
|
|
243
|
-
gitgo undo changes # Permanently
|
|
245
|
+
gitgo undo commit # Undo the last commit without losing files
|
|
246
|
+
gitgo undo add # Unstage files
|
|
247
|
+
gitgo undo changes # Permanently discard all new files and uncommitted edits
|
|
244
248
|
```
|
|
245
249
|
|
|
246
250
|
### `gitgo state`
|
|
247
251
|
|
|
248
|
-
|
|
252
|
+
Named, indexed interface over `git stash`.
|
|
249
253
|
|
|
250
254
|
```bash
|
|
251
255
|
gitgo state list # show all saved states
|
|
@@ -254,6 +258,7 @@ gitgo state load [id] # restore a state by index
|
|
|
254
258
|
gitgo state delete [id] # delete a state by index
|
|
255
259
|
gitgo state delete -a # delete all saved states
|
|
256
260
|
```
|
|
261
|
+
|
|
257
262
|
*Short aliases:* `-l`, `-s`, `-o`, `-d`
|
|
258
263
|
|
|
259
264
|
### `gitgo user`
|
|
@@ -291,19 +296,17 @@ gitgo -r # verify GitGo is ready
|
|
|
291
296
|
|
|
292
297
|
## How It Works
|
|
293
298
|
|
|
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
|
|
299
|
+
- **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.
|
|
300
|
+
- **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
301
|
- **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
|
|
302
|
+
- **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
303
|
- **State Management:** `gitgo state` wraps `git stash` with named saves, indexed listing, and confirmation prompts.
|
|
299
304
|
|
|
300
305
|
---
|
|
301
306
|
|
|
302
307
|
## Contributing
|
|
303
308
|
|
|
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.
|
|
309
|
+
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
310
|
|
|
308
311
|
---
|
|
309
312
|
|
|
@@ -313,7 +316,7 @@ including project structure, test instructions, commit conventions, and a
|
|
|
313
316
|
<table>
|
|
314
317
|
<tr>
|
|
315
318
|
<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 />
|
|
319
|
+
<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
320
|
</tr>
|
|
318
321
|
</table>
|
|
319
322
|
</div>
|
|
@@ -324,8 +327,4 @@ including project structure, test instructions, commit conventions, and a
|
|
|
324
327
|
|
|
325
328
|
Distributed under the **GPLv3** License. See [`LICENSE`](LICENSE) for details.
|
|
326
329
|
|
|
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>
|
|
330
|
+
---
|
|
@@ -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.0"
|
|
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
|
+
|