pygitgo 1.7.1__tar.gz → 1.8.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.7.1/src/pygitgo.egg-info → pygitgo-1.8.0}/PKG-INFO +94 -16
- {pygitgo-1.7.1 → pygitgo-1.8.0}/README.md +94 -16
- {pygitgo-1.7.1 → pygitgo-1.8.0}/pyproject.toml +1 -1
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/auth/account.py +0 -2
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/auth/manager.py +3 -1
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/auth/ssh_utils.py +0 -24
- pygitgo-1.8.0/src/pygitgo/commands/init.py +310 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/link.py +16 -11
- pygitgo-1.8.0/src/pygitgo/commands/new.py +21 -0
- pygitgo-1.8.0/src/pygitgo/commands/repo.py +133 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/exceptions.py +0 -10
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/main.py +111 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/utils/config.py +6 -4
- pygitgo-1.8.0/src/pygitgo/utils/platform.py +50 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0/src/pygitgo.egg-info}/PKG-INFO +94 -16
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo.egg-info/SOURCES.txt +6 -0
- pygitgo-1.8.0/tests/test_init.py +113 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_manager.py +5 -5
- pygitgo-1.8.0/tests/test_new.py +27 -0
- pygitgo-1.8.0/tests/test_platform.py +62 -0
- pygitgo-1.8.0/tests/test_repo.py +125 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_ssh_utils.py +4 -5
- pygitgo-1.7.1/src/pygitgo/utils/platform.py +0 -27
- pygitgo-1.7.1/tests/test_platform.py +0 -30
- {pygitgo-1.7.1 → pygitgo-1.8.0}/LICENSE +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/setup.cfg +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/__init__.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/auth/__init__.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/__init__.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/config.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/git_branch.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/git_core.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/git_remote.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/jump.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/pull.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/push.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/staging.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/stash.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/state.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/undo.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/commands/user.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/utils/__init__.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/utils/bootstrap.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/utils/colors.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/utils/executor.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/utils/update_checker.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo/utils/validators.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo.egg-info/dependency_links.txt +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo.egg-info/entry_points.txt +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo.egg-info/requires.txt +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/src/pygitgo.egg-info/top_level.txt +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_account.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_bootstrap.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_config_command.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_config_utils.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_git_branch.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_git_core.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_git_remote.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_jump.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_link.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_pull.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_push.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_staging.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_stash.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_state.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_undo.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_update_checker.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_user.py +0 -0
- {pygitgo-1.7.1 → pygitgo-1.8.0}/tests/test_validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygitgo
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.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
|
|
@@ -32,7 +32,7 @@ Dynamic: license-file
|
|
|
32
32
|
[](https://pypi.org/project/pygitgo)
|
|
33
33
|
[](https://www.python.org/downloads/)
|
|
34
34
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
35
|
-
[](https://github.com/sponsors/Huerte)
|
|
36
36
|
[](https://github.com/Huerte/GitGo)
|
|
37
37
|
|
|
38
38
|
**Stop typing the same five Git commands. Run one instead.**
|
|
@@ -41,24 +41,24 @@ Dynamic: license-file
|
|
|
41
41
|
|
|
42
42
|
<br />
|
|
43
43
|
|
|
44
|
-
If GitGo saves you time,
|
|
44
|
+
If GitGo saves you time, give it a star. If you want to go further, sponsoring helps keep it going.
|
|
45
45
|
|
|
46
|
-
<a href="https://
|
|
47
|
-
<img src="https://
|
|
46
|
+
<a href="https://github.com/sponsors/Huerte">
|
|
47
|
+
<img src="https://img.shields.io/badge/Sponsor%20on%20GitHub-%E2%9D%A4-EA4AAA?style=for-the-badge&logo=github" alt="Sponsor on GitHub" />
|
|
48
48
|
</a>
|
|
49
49
|
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
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,
|
|
54
|
+
GitGo wraps your most-typed git commands into shorter ones. It covers init, scaffold, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, a named stash interface called state management, and a one-shot quickstart command that takes you from nothing to a live GitHub repo in seconds.
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
# Instead of this:
|
|
58
|
-
git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
|
|
58
|
+
mkdir my-app && cd my-app && git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
|
|
59
59
|
|
|
60
60
|
# Run this:
|
|
61
|
-
gitgo
|
|
61
|
+
gitgo new my-app python
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
---
|
|
@@ -88,6 +88,9 @@ gitgo link https://github.com/username/repo.git "init"
|
|
|
88
88
|
## Features
|
|
89
89
|
|
|
90
90
|
- **Single commands for linking, pushing, and stashing.** No more chaining five commands together.
|
|
91
|
+
- **Quickstart with `new`:** One command to scaffold your project, create the GitHub repo, and push it. No switching tabs, no manual steps.
|
|
92
|
+
- **Project scaffolding with `init`:** Generates a language-specific project structure with a `.gitignore` from GitHub's official templates. Supports Python, Node, Rust, Go, C#, and more.
|
|
93
|
+
- **Remote repo creation with `repo`:** Creates a GitHub repo directly from the terminal without touching a browser.
|
|
91
94
|
- **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
95
|
- **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
96
|
- **State management:** Named, indexed stash. Run `state list` to see what you saved. No more `stash@{2}` archaeology.
|
|
@@ -155,21 +158,47 @@ pip install -e .
|
|
|
155
158
|
|
|
156
159
|
### 1. Set Up Your Identity
|
|
157
160
|
|
|
158
|
-
Run this once on
|
|
161
|
+
Run this once on each machine you use. GitGo generates an SSH key, prints it for you to copy, and opens GitHub so you can add it. You add the same key twice: once as an **Authentication Key** (to push and pull), once as a **Signing Key** (so your commits show Verified). After that, GitGo tests the connection and sets up your Git identity automatically.
|
|
159
162
|
|
|
160
163
|
```bash
|
|
161
164
|
gitgo user login
|
|
162
165
|
```
|
|
163
166
|
|
|
164
|
-
|
|
167
|
+
For a full walkthrough with screenshots, see the [Login Guide](docs/login-guide.md).
|
|
165
168
|
|
|
166
|
-
|
|
169
|
+
### 2. Start a New Project From Scratch
|
|
170
|
+
|
|
171
|
+
One command scaffolds the local project, creates the GitHub repo, and pushes it. No tab switching.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
gitgo new my-app python
|
|
175
|
+
gitgo new my-app rust --private
|
|
176
|
+
gitgo new my-app # no scaffold, just the repo and push
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Or use the individual steps if you want more control:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Step 1: scaffold the project locally
|
|
183
|
+
gitgo init my-app python
|
|
184
|
+
|
|
185
|
+
# Step 2: create the remote GitHub repo
|
|
186
|
+
cd my-app
|
|
187
|
+
gitgo repo my-app --private
|
|
188
|
+
|
|
189
|
+
# Step 3: connect and push
|
|
190
|
+
gitgo link https://github.com/username/my-app.git
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 3. Link an Existing Project to GitHub
|
|
194
|
+
|
|
195
|
+
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
196
|
|
|
168
197
|
```bash
|
|
169
198
|
gitgo link https://github.com/username/repo.git "Initial commit"
|
|
170
199
|
```
|
|
171
200
|
|
|
172
|
-
###
|
|
201
|
+
### 4. Push Changes
|
|
173
202
|
|
|
174
203
|
```bash
|
|
175
204
|
# Push to an existing branch
|
|
@@ -179,7 +208,7 @@ gitgo push main "Fix auth bug"
|
|
|
179
208
|
gitgo push -n feat/login "Add login flow"
|
|
180
209
|
```
|
|
181
210
|
|
|
182
|
-
###
|
|
211
|
+
### 5. Switch Branches
|
|
183
212
|
|
|
184
213
|
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
214
|
|
|
@@ -187,7 +216,7 @@ Switch branches with uncommitted work in progress. `jump` stashes your changes,
|
|
|
187
216
|
gitgo jump feat/new-login
|
|
188
217
|
```
|
|
189
218
|
|
|
190
|
-
###
|
|
219
|
+
### 6. Undo Mistakes
|
|
191
220
|
|
|
192
221
|
Undo recent mistakes with commands named for what they undo.
|
|
193
222
|
|
|
@@ -199,7 +228,7 @@ gitgo undo link # Remove remote and undo initial commit
|
|
|
199
228
|
gitgo undo push # DANGER: Revert last push with a force-push
|
|
200
229
|
```
|
|
201
230
|
|
|
202
|
-
###
|
|
231
|
+
### 7. Save Your Work-in-Progress
|
|
203
232
|
|
|
204
233
|
```bash
|
|
205
234
|
gitgo state save "halfway through refactor"
|
|
@@ -207,7 +236,7 @@ gitgo state list
|
|
|
207
236
|
gitgo state load 1
|
|
208
237
|
```
|
|
209
238
|
|
|
210
|
-
###
|
|
239
|
+
### 8. Custom Defaults
|
|
211
240
|
|
|
212
241
|
```bash
|
|
213
242
|
gitgo config set default-branch develop
|
|
@@ -219,6 +248,55 @@ gitgo config get default-branch
|
|
|
219
248
|
|
|
220
249
|
## Command Reference
|
|
221
250
|
|
|
251
|
+
### `gitgo new`
|
|
252
|
+
|
|
253
|
+
One-shot quickstart. Scaffolds a local project, creates the GitHub remote repo, and pushes, all in one command.
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
gitgo new <name> [lang]
|
|
257
|
+
gitgo new my-app python # scaffold Python project and push
|
|
258
|
+
gitgo new my-app rust --private # private Rust project
|
|
259
|
+
gitgo new my-app # no scaffold, just create repo and push
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
| Flag | Description |
|
|
263
|
+
|------|-------------|
|
|
264
|
+
| `lang` | Language to scaffold. Options: `python`, `node`, `rust`, `go`, `cs`, and more |
|
|
265
|
+
| `--template OWNER/REPO` | Use a GitHub template repo instead of a language scaffold |
|
|
266
|
+
| `-p`, `--private` | Create a private repository |
|
|
267
|
+
| `-d`, `--description TEXT` | Short description shown on GitHub |
|
|
268
|
+
|
|
269
|
+
### `gitgo init`
|
|
270
|
+
|
|
271
|
+
Scaffolds a project folder locally. Creates a README, `.gitignore` (fetched from GitHub's official templates), and language-specific starter files.
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
gitgo init my-app python # generates pyproject.toml and .python-version
|
|
275
|
+
gitgo init my-app node # generates package.json and index.js
|
|
276
|
+
gitgo init my-app cs # generates .csproj and Program.cs
|
|
277
|
+
gitgo init my-app --template owner/repo # slug format
|
|
278
|
+
gitgo init my-app --template https://github.com/owner/repo # full URL accepted too
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Supported languages: `python` (`py`), `node` (`js`, `ts`), `rust` (`rs`), `go` (`golang`), `csharp` (`cs`), and any language with a `.gitignore` template on GitHub.
|
|
282
|
+
|
|
283
|
+
### `gitgo repo`
|
|
284
|
+
|
|
285
|
+
Creates a remote GitHub repository without touching your local files.
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
gitgo repo [name] # use current directory name if no name given
|
|
289
|
+
gitgo repo my-app --private
|
|
290
|
+
gitgo repo my-app -d "My project description"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
| Flag | Description |
|
|
294
|
+
|------|-------------|
|
|
295
|
+
| `-p`, `--private` | Create a private repository |
|
|
296
|
+
| `-d`, `--description TEXT` | Short description shown on GitHub |
|
|
297
|
+
|
|
298
|
+
On first run, GitGo opens GitHub's PAT page and prompts you to paste a token with `repo` scope. The token is saved to git config for future calls. If the token expires, GitGo detects the 401 and re-prompts automatically.
|
|
299
|
+
|
|
222
300
|
### `gitgo push`
|
|
223
301
|
|
|
224
302
|
Stage, commit, and push in one command.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://pypi.org/project/pygitgo)
|
|
8
8
|
[](https://www.python.org/downloads/)
|
|
9
9
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
10
|
-
[](https://github.com/sponsors/Huerte)
|
|
11
11
|
[](https://github.com/Huerte/GitGo)
|
|
12
12
|
|
|
13
13
|
**Stop typing the same five Git commands. Run one instead.**
|
|
@@ -16,24 +16,24 @@
|
|
|
16
16
|
|
|
17
17
|
<br />
|
|
18
18
|
|
|
19
|
-
If GitGo saves you time,
|
|
19
|
+
If GitGo saves you time, give it a star. If you want to go further, sponsoring helps keep it going.
|
|
20
20
|
|
|
21
|
-
<a href="https://
|
|
22
|
-
<img src="https://
|
|
21
|
+
<a href="https://github.com/sponsors/Huerte">
|
|
22
|
+
<img src="https://img.shields.io/badge/Sponsor%20on%20GitHub-%E2%9D%A4-EA4AAA?style=for-the-badge&logo=github" alt="Sponsor on GitHub" />
|
|
23
23
|
</a>
|
|
24
24
|
|
|
25
25
|
</div>
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
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,
|
|
29
|
+
GitGo wraps your most-typed git commands into shorter ones. It covers init, scaffold, add, commit, push, branch, and stash. It also includes features most wrappers leave out: SSH key setup, HTTPS-to-SSH conversion, a named stash interface called state management, and a one-shot quickstart command that takes you from nothing to a live GitHub repo in seconds.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
# Instead of this:
|
|
33
|
-
git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
|
|
33
|
+
mkdir my-app && cd my-app && git init && git add . && git commit -m "init" && git remote add origin <url> && git push -u origin main
|
|
34
34
|
|
|
35
35
|
# Run this:
|
|
36
|
-
gitgo
|
|
36
|
+
gitgo new my-app python
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
---
|
|
@@ -63,6 +63,9 @@ gitgo link https://github.com/username/repo.git "init"
|
|
|
63
63
|
## Features
|
|
64
64
|
|
|
65
65
|
- **Single commands for linking, pushing, and stashing.** No more chaining five commands together.
|
|
66
|
+
- **Quickstart with `new`:** One command to scaffold your project, create the GitHub repo, and push it. No switching tabs, no manual steps.
|
|
67
|
+
- **Project scaffolding with `init`:** Generates a language-specific project structure with a `.gitignore` from GitHub's official templates. Supports Python, Node, Rust, Go, C#, and more.
|
|
68
|
+
- **Remote repo creation with `repo`:** Creates a GitHub repo directly from the terminal without touching a browser.
|
|
66
69
|
- **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
70
|
- **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
71
|
- **State management:** Named, indexed stash. Run `state list` to see what you saved. No more `stash@{2}` archaeology.
|
|
@@ -130,21 +133,47 @@ pip install -e .
|
|
|
130
133
|
|
|
131
134
|
### 1. Set Up Your Identity
|
|
132
135
|
|
|
133
|
-
Run this once on
|
|
136
|
+
Run this once on each machine you use. GitGo generates an SSH key, prints it for you to copy, and opens GitHub so you can add it. You add the same key twice: once as an **Authentication Key** (to push and pull), once as a **Signing Key** (so your commits show Verified). After that, GitGo tests the connection and sets up your Git identity automatically.
|
|
134
137
|
|
|
135
138
|
```bash
|
|
136
139
|
gitgo user login
|
|
137
140
|
```
|
|
138
141
|
|
|
139
|
-
|
|
142
|
+
For a full walkthrough with screenshots, see the [Login Guide](docs/login-guide.md).
|
|
140
143
|
|
|
141
|
-
|
|
144
|
+
### 2. Start a New Project From Scratch
|
|
145
|
+
|
|
146
|
+
One command scaffolds the local project, creates the GitHub repo, and pushes it. No tab switching.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
gitgo new my-app python
|
|
150
|
+
gitgo new my-app rust --private
|
|
151
|
+
gitgo new my-app # no scaffold, just the repo and push
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Or use the individual steps if you want more control:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Step 1: scaffold the project locally
|
|
158
|
+
gitgo init my-app python
|
|
159
|
+
|
|
160
|
+
# Step 2: create the remote GitHub repo
|
|
161
|
+
cd my-app
|
|
162
|
+
gitgo repo my-app --private
|
|
163
|
+
|
|
164
|
+
# Step 3: connect and push
|
|
165
|
+
gitgo link https://github.com/username/my-app.git
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 3. Link an Existing Project to GitHub
|
|
169
|
+
|
|
170
|
+
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
171
|
|
|
143
172
|
```bash
|
|
144
173
|
gitgo link https://github.com/username/repo.git "Initial commit"
|
|
145
174
|
```
|
|
146
175
|
|
|
147
|
-
###
|
|
176
|
+
### 4. Push Changes
|
|
148
177
|
|
|
149
178
|
```bash
|
|
150
179
|
# Push to an existing branch
|
|
@@ -154,7 +183,7 @@ gitgo push main "Fix auth bug"
|
|
|
154
183
|
gitgo push -n feat/login "Add login flow"
|
|
155
184
|
```
|
|
156
185
|
|
|
157
|
-
###
|
|
186
|
+
### 5. Switch Branches
|
|
158
187
|
|
|
159
188
|
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
189
|
|
|
@@ -162,7 +191,7 @@ Switch branches with uncommitted work in progress. `jump` stashes your changes,
|
|
|
162
191
|
gitgo jump feat/new-login
|
|
163
192
|
```
|
|
164
193
|
|
|
165
|
-
###
|
|
194
|
+
### 6. Undo Mistakes
|
|
166
195
|
|
|
167
196
|
Undo recent mistakes with commands named for what they undo.
|
|
168
197
|
|
|
@@ -174,7 +203,7 @@ gitgo undo link # Remove remote and undo initial commit
|
|
|
174
203
|
gitgo undo push # DANGER: Revert last push with a force-push
|
|
175
204
|
```
|
|
176
205
|
|
|
177
|
-
###
|
|
206
|
+
### 7. Save Your Work-in-Progress
|
|
178
207
|
|
|
179
208
|
```bash
|
|
180
209
|
gitgo state save "halfway through refactor"
|
|
@@ -182,7 +211,7 @@ gitgo state list
|
|
|
182
211
|
gitgo state load 1
|
|
183
212
|
```
|
|
184
213
|
|
|
185
|
-
###
|
|
214
|
+
### 8. Custom Defaults
|
|
186
215
|
|
|
187
216
|
```bash
|
|
188
217
|
gitgo config set default-branch develop
|
|
@@ -194,6 +223,55 @@ gitgo config get default-branch
|
|
|
194
223
|
|
|
195
224
|
## Command Reference
|
|
196
225
|
|
|
226
|
+
### `gitgo new`
|
|
227
|
+
|
|
228
|
+
One-shot quickstart. Scaffolds a local project, creates the GitHub remote repo, and pushes, all in one command.
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
gitgo new <name> [lang]
|
|
232
|
+
gitgo new my-app python # scaffold Python project and push
|
|
233
|
+
gitgo new my-app rust --private # private Rust project
|
|
234
|
+
gitgo new my-app # no scaffold, just create repo and push
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
| Flag | Description |
|
|
238
|
+
|------|-------------|
|
|
239
|
+
| `lang` | Language to scaffold. Options: `python`, `node`, `rust`, `go`, `cs`, and more |
|
|
240
|
+
| `--template OWNER/REPO` | Use a GitHub template repo instead of a language scaffold |
|
|
241
|
+
| `-p`, `--private` | Create a private repository |
|
|
242
|
+
| `-d`, `--description TEXT` | Short description shown on GitHub |
|
|
243
|
+
|
|
244
|
+
### `gitgo init`
|
|
245
|
+
|
|
246
|
+
Scaffolds a project folder locally. Creates a README, `.gitignore` (fetched from GitHub's official templates), and language-specific starter files.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
gitgo init my-app python # generates pyproject.toml and .python-version
|
|
250
|
+
gitgo init my-app node # generates package.json and index.js
|
|
251
|
+
gitgo init my-app cs # generates .csproj and Program.cs
|
|
252
|
+
gitgo init my-app --template owner/repo # slug format
|
|
253
|
+
gitgo init my-app --template https://github.com/owner/repo # full URL accepted too
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Supported languages: `python` (`py`), `node` (`js`, `ts`), `rust` (`rs`), `go` (`golang`), `csharp` (`cs`), and any language with a `.gitignore` template on GitHub.
|
|
257
|
+
|
|
258
|
+
### `gitgo repo`
|
|
259
|
+
|
|
260
|
+
Creates a remote GitHub repository without touching your local files.
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
gitgo repo [name] # use current directory name if no name given
|
|
264
|
+
gitgo repo my-app --private
|
|
265
|
+
gitgo repo my-app -d "My project description"
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
| Flag | Description |
|
|
269
|
+
|------|-------------|
|
|
270
|
+
| `-p`, `--private` | Create a private repository |
|
|
271
|
+
| `-d`, `--description TEXT` | Short description shown on GitHub |
|
|
272
|
+
|
|
273
|
+
On first run, GitGo opens GitHub's PAT page and prompts you to paste a token with `repo` scope. The token is saved to git config for future calls. If the token expires, GitGo detects the 401 and re-prompts automatically.
|
|
274
|
+
|
|
197
275
|
### `gitgo push`
|
|
198
276
|
|
|
199
277
|
Stage, commit, and push in one command.
|
|
@@ -331,4 +409,4 @@ Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for the full
|
|
|
331
409
|
|
|
332
410
|
Distributed under the **GPLv3** License. See [`LICENSE`](LICENSE) for details.
|
|
333
411
|
|
|
334
|
-
---
|
|
412
|
+
---
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pygitgo"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.8.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"}
|
|
@@ -21,7 +21,6 @@ def get_user():
|
|
|
21
21
|
|
|
22
22
|
return name, email
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
def set_user(name, email):
|
|
26
25
|
run_command(["git", "config", "--global", "user.name", name])
|
|
27
26
|
run_command(["git", "config", "--global", "user.email", email])
|
|
@@ -66,4 +65,3 @@ def ensure_user_configure(default_email=None, default_username=None):
|
|
|
66
65
|
error("Invalid configuration. Name and Email are required.")
|
|
67
66
|
return False
|
|
68
67
|
|
|
69
|
-
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from pygitgo.utils.colors import info, success, warning, error
|
|
2
2
|
from pygitgo.utils.executor import run_command
|
|
3
3
|
from pygitgo.exceptions import GitCommandError
|
|
4
|
+
from pygitgo.utils.platform import open_url
|
|
4
5
|
from . import ssh_utils
|
|
5
6
|
import os
|
|
6
7
|
|
|
@@ -39,7 +40,7 @@ def login():
|
|
|
39
40
|
info(" 2. Once as 'Signing Key' (so your commits show as Verified)")
|
|
40
41
|
info("Both entries use the exact same key text.")
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
open_url("https://github.com/settings/ssh/new")
|
|
43
44
|
|
|
44
45
|
input(
|
|
45
46
|
"After adding both keys on GitHub,\n"
|
|
@@ -65,6 +66,7 @@ def login():
|
|
|
65
66
|
info(" 1. The key was not pasted on GitHub")
|
|
66
67
|
info(" 2. SSH agent is not running (try: eval $(ssh-agent) && ssh-add)")
|
|
67
68
|
info(" 3. Network or firewall is blocking SSH connections")
|
|
69
|
+
info("Need help? Full guide: https://github.com/Huerte/GitGo/blob/main/docs/login-guide.md")
|
|
68
70
|
return False
|
|
69
71
|
|
|
70
72
|
def logout():
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
from pygitgo.exceptions import GitCommandError, GitGoError
|
|
2
2
|
from pygitgo.utils.colors import info, success, warning
|
|
3
3
|
from pygitgo.utils.executor import run_command
|
|
4
|
-
from pygitgo.utils import platform as platform_utils
|
|
5
4
|
from pathlib import Path
|
|
6
|
-
import webbrowser
|
|
7
5
|
import subprocess
|
|
8
|
-
import shutil
|
|
9
6
|
import os
|
|
10
7
|
import re
|
|
11
8
|
|
|
@@ -103,27 +100,6 @@ def generate_ssh_key(email):
|
|
|
103
100
|
return key_path
|
|
104
101
|
|
|
105
102
|
|
|
106
|
-
def open_github_settings():
|
|
107
|
-
url = "https://github.com/settings/ssh/new"
|
|
108
|
-
opened = False
|
|
109
|
-
|
|
110
|
-
try:
|
|
111
|
-
if platform_utils.is_termux():
|
|
112
|
-
if shutil.which("termux-open"):
|
|
113
|
-
subprocess.run(["termux-open", url], check=False)
|
|
114
|
-
opened = True
|
|
115
|
-
else:
|
|
116
|
-
opened = webbrowser.open(url)
|
|
117
|
-
except Exception:
|
|
118
|
-
opened = False
|
|
119
|
-
|
|
120
|
-
if not opened:
|
|
121
|
-
warning("Could not open browser automatically.")
|
|
122
|
-
|
|
123
|
-
info("\nIf the browser did not open, visit this URL manually:")
|
|
124
|
-
print(f"\n {url}\n")
|
|
125
|
-
|
|
126
|
-
|
|
127
103
|
def convert_https_to_ssh(url):
|
|
128
104
|
pattern = r'^https?://github\.com/([^/]+)/([^/]+?)(?:\.git)?/?$'
|
|
129
105
|
match = re.match(pattern, url.strip())
|