gitpush-tool 0.4.0__tar.gz → 0.4.2__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.
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/LONG_DESCRIPTION.md +142 -107
- {gitpush_tool-0.4.0/gitpush_tool.egg-info → gitpush_tool-0.4.2}/PKG-INFO +36 -1
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/README.md +182 -145
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/gitpush/__doc__.py +8 -2
- gitpush_tool-0.4.2/gitpush/__init__.py +1 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/gitpush/cli.py +824 -807
- gitpush_tool-0.4.2/gitpush/status.py +369 -0
- gitpush_tool-0.4.2/gitpush/undo.py +359 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2/gitpush_tool.egg-info}/PKG-INFO +36 -1
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/gitpush_tool.egg-info/SOURCES.txt +5 -1
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/gitpush_tool.egg-info/entry_points.txt +2 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/setup.py +5 -7
- gitpush_tool-0.4.2/tests/test_cli.py +0 -0
- gitpush_tool-0.4.2/tests/test_safety.py +0 -0
- gitpush_tool-0.4.2/tests/test_status.py +113 -0
- gitpush_tool-0.4.2/tests/test_undo.py +80 -0
- gitpush_tool-0.4.0/gitpush/__init__.py +0 -1
- gitpush_tool-0.4.0/tests/test_cli.py +0 -25
- gitpush_tool-0.4.0/tests/test_safety.py +0 -169
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/LICENSE +0 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/MANIFEST.in +0 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/gitpush/safety.py +0 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/gitpush_tool.egg-info/dependency_links.txt +0 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/gitpush_tool.egg-info/top_level.txt +0 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/pyproject.toml +0 -0
- {gitpush_tool-0.4.0 → gitpush_tool-0.4.2}/setup.cfg +0 -0
|
@@ -1,107 +1,142 @@
|
|
|
1
|
-
# GitPush Tool 🚀
|
|
2
|
-
|
|
3
|
-
[](https://pypi.org/project/gitpush-tool/)
|
|
4
|
-
[](https://github.com/inevitablegs/gitpush/blob/main/LICENSE)
|
|
5
|
-
|
|
6
|
-
A supercharged Git CLI and safety tool that simplifies repository creation and pushing with intelligent defaults, rich pre-push diffstat inspection (`+++---` lines), and active safeguards against dangerous Git commands.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## ✨ Features
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
# GitPush Tool 🚀
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/gitpush-tool/)
|
|
4
|
+
[](https://github.com/inevitablegs/gitpush/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
A supercharged Git CLI and safety tool that simplifies repository creation and pushing with intelligent defaults, rich pre-push diffstat inspection (`+++---` lines), and active safeguards against dangerous Git commands.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ✨ Features
|
|
11
|
+
|
|
12
|
+
- **Decision-Support Status Dashboard (`gitpush status`):** Actionable repository overview showing worktree breakdown, commit sync, intelligent next-step recommendations, and a 0-100 Repo Health score.
|
|
13
|
+
- **Pre-Push Safety & Diffstat Preview:** See changed files, line additions/deletions (`+X, -Y`), ahead/behind status, and pending commits before pushing.
|
|
14
|
+
- **Dangerous Git Operation Guard:** Analyzes and protects against risky actions (`reset --hard`, force pushes, deleting unmerged branches, dirty `git clean`, detached HEADs).
|
|
15
|
+
- **Protected Branch Safeguard:** Automatically detects and alerts when pushing or force-pushing to `main`, `master`, `prod`, `release`, or `dev`.
|
|
16
|
+
- **One-Command GitHub Repo Creation:** Initialize Git, create a remote GitHub repo, and push in a single step via GitHub CLI (`gh`).
|
|
17
|
+
- **Safe Force Pushing:** Uses `--force-with-lease` by default to avoid overwriting teammate commits.
|
|
18
|
+
- **Dry-Run Mode:** Preview your push inspection without modifying anything.
|
|
19
|
+
- **Non-Interactive & CI Friendly:** Skip prompts with `-y` or `--yes`.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📊 Decision-Support Status Dashboard (`gitpush status`)
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
Repository: my-project
|
|
27
|
+
Branch: feature/payment
|
|
28
|
+
Tracking: origin/feature/payment
|
|
29
|
+
|
|
30
|
+
WORKTREE
|
|
31
|
+
────────────────────────
|
|
32
|
+
Modified 4
|
|
33
|
+
Added 2
|
|
34
|
+
Deleted 1
|
|
35
|
+
Untracked 3
|
|
36
|
+
Line Changes +142, -18
|
|
37
|
+
|
|
38
|
+
COMMITS
|
|
39
|
+
────────────────────────
|
|
40
|
+
Ahead 3
|
|
41
|
+
Behind 1
|
|
42
|
+
|
|
43
|
+
PUSH / STATUS
|
|
44
|
+
────────────────────────
|
|
45
|
+
⚠ Remote has 1 commit(s) you don't have locally.
|
|
46
|
+
|
|
47
|
+
Recommended:
|
|
48
|
+
git pull --rebase
|
|
49
|
+
gitpush "Commit message"
|
|
50
|
+
|
|
51
|
+
Health:
|
|
52
|
+
82/100 [████████░░] Good (Minor Action Needed)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 🛡️ Pre-Push Warning & Inspection
|
|
58
|
+
|
|
59
|
+
Whenever you run `gitpush`, you get an instant, clear breakdown of your repository state:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
═══════════════════════════════════════════════════════════════
|
|
63
|
+
🚀 GITPUSH PRE-PUSH INSPECTION & SUMMARY
|
|
64
|
+
═══════════════════════════════════════════════════════════════
|
|
65
|
+
|
|
66
|
+
Repository: my-project (/Users/username/Projects/my-project)
|
|
67
|
+
Target Branch: main ⚠️ [PROTECTED BRANCH] ──> origin/main
|
|
68
|
+
Sync Status: Ahead: 2 commit(s), Behind: 0 commit(s)
|
|
69
|
+
Action: Commit: 'Add user authentication flow'
|
|
70
|
+
|
|
71
|
+
Warnings:
|
|
72
|
+
⚠️ Pushing directly to protected branch 'main'.
|
|
73
|
+
|
|
74
|
+
Changed Files (3 file(s), +84 / -12):
|
|
75
|
+
M src/auth.py (+65, -8)
|
|
76
|
+
M README.md (+19, -4)
|
|
77
|
+
?? config/auth.json (+12 lines, untracked)
|
|
78
|
+
|
|
79
|
+
Pending Commits to Push (2):
|
|
80
|
+
• 8f3d1a2 Initial auth scaffold
|
|
81
|
+
• 4e9c7b1 Implement JWT token verification
|
|
82
|
+
═══════════════════════════════════════════════════════════════
|
|
83
|
+
|
|
84
|
+
Continue? [y/N]:
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🛑 Dangerous Command Guard
|
|
90
|
+
|
|
91
|
+
Use `gitpush guard <command>` (or `gitpush-guard <command>`) before executing risky Git operations:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
Command: [WARNING ⚠️]
|
|
95
|
+
git reset --hard HEAD~5
|
|
96
|
+
|
|
97
|
+
Changes that may be lost:
|
|
98
|
+
5 commit(s)
|
|
99
|
+
12 modified/staged file(s)
|
|
100
|
+
|
|
101
|
+
Risks & Warnings:
|
|
102
|
+
⚠️ All uncommitted changes in tracked files will be permanently discarded.
|
|
103
|
+
⚠️ 12 uncommitted modified/staged file(s) will be lost immediately.
|
|
104
|
+
⚠️ 5 commit(s) will be unlinked from current branch HEAD.
|
|
105
|
+
|
|
106
|
+
Repository:
|
|
107
|
+
my-project
|
|
108
|
+
|
|
109
|
+
Continue? [y/N]:
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### What Guard Detects:
|
|
113
|
+
- **`reset --hard`**: Identifies uncommitted files and commits that will be orphaned.
|
|
114
|
+
- **`force push`**: Detects remote overwrite risks and protected branch overrides.
|
|
115
|
+
- **`deleting branches`**: Identifies unmerged commits that would be lost.
|
|
116
|
+
- **`cleaning untracked files`**: Warns of files/directories `git clean -fd` will permanently delete.
|
|
117
|
+
- **`checkout / restore`**: Flags uncommitted modifications about to be discarded.
|
|
118
|
+
- **`rebasing with uncommitted work`**: Warns of dirty working trees before rebase conflicts occur.
|
|
119
|
+
- **`pushing to protected branches`**: Direct pushes to `main`, `master`, `prod`, `dev`, etc.
|
|
120
|
+
- **`detached HEAD situations`**: Warns when working or committing on detached HEADs.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 🛠️ Usage & Commands
|
|
125
|
+
|
|
126
|
+
| Command | Description |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `gitpush "Commit message"` | Stages all changes, previews diffs, commits, and pushes. |
|
|
129
|
+
| `gitpush` | Pushes staged/unpushed changes with safety preview. |
|
|
130
|
+
| `gitpush -y` | Pushes immediately without confirmation prompt. |
|
|
131
|
+
| `gitpush --dry-run` | Shows the pre-push inspection and exits without changes. |
|
|
132
|
+
| `gitpush --force` | Safe force push using `--force-with-lease`. |
|
|
133
|
+
| `gitpush --tags` | Pushes all local tags. |
|
|
134
|
+
| `gitpush guard <git command>` | Inspects and guards any dangerous Git command. |
|
|
135
|
+
| `gitpush --init` | Initializes Git repo and creates default `.gitignore`. |
|
|
136
|
+
| `gitpush --new-repo <name>` | Creates a new GitHub repo and pushes in one step. |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 📄 License
|
|
141
|
+
|
|
142
|
+
MIT License. See [LICENSE](https://github.com/inevitablegs/gitpush/blob/main/LICENSE) for details.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpush-tool
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Supercharged Git push tool with automatic GitHub repo creation and pushing
|
|
5
5
|
Home-page: https://github.com/inevitablegs/gitpush
|
|
6
6
|
Author: Ganesh Sonawane
|
|
@@ -38,6 +38,7 @@ A supercharged Git CLI and safety tool that simplifies repository creation and p
|
|
|
38
38
|
|
|
39
39
|
## ✨ Features
|
|
40
40
|
|
|
41
|
+
- **Decision-Support Status Dashboard (`gitpush status`):** Actionable repository overview showing worktree breakdown, commit sync, intelligent next-step recommendations, and a 0-100 Repo Health score.
|
|
41
42
|
- **Pre-Push Safety & Diffstat Preview:** See changed files, line additions/deletions (`+X, -Y`), ahead/behind status, and pending commits before pushing.
|
|
42
43
|
- **Dangerous Git Operation Guard:** Analyzes and protects against risky actions (`reset --hard`, force pushes, deleting unmerged branches, dirty `git clean`, detached HEADs).
|
|
43
44
|
- **Protected Branch Safeguard:** Automatically detects and alerts when pushing or force-pushing to `main`, `master`, `prod`, `release`, or `dev`.
|
|
@@ -48,6 +49,40 @@ A supercharged Git CLI and safety tool that simplifies repository creation and p
|
|
|
48
49
|
|
|
49
50
|
---
|
|
50
51
|
|
|
52
|
+
## 📊 Decision-Support Status Dashboard (`gitpush status`)
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
Repository: my-project
|
|
56
|
+
Branch: feature/payment
|
|
57
|
+
Tracking: origin/feature/payment
|
|
58
|
+
|
|
59
|
+
WORKTREE
|
|
60
|
+
────────────────────────
|
|
61
|
+
Modified 4
|
|
62
|
+
Added 2
|
|
63
|
+
Deleted 1
|
|
64
|
+
Untracked 3
|
|
65
|
+
Line Changes +142, -18
|
|
66
|
+
|
|
67
|
+
COMMITS
|
|
68
|
+
────────────────────────
|
|
69
|
+
Ahead 3
|
|
70
|
+
Behind 1
|
|
71
|
+
|
|
72
|
+
PUSH / STATUS
|
|
73
|
+
────────────────────────
|
|
74
|
+
⚠ Remote has 1 commit(s) you don't have locally.
|
|
75
|
+
|
|
76
|
+
Recommended:
|
|
77
|
+
git pull --rebase
|
|
78
|
+
gitpush "Commit message"
|
|
79
|
+
|
|
80
|
+
Health:
|
|
81
|
+
82/100 [████████░░] Good (Minor Action Needed)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
51
86
|
## 🛡️ Pre-Push Warning & Inspection
|
|
52
87
|
|
|
53
88
|
Whenever you run `gitpush`, you get an instant, clear breakdown of your repository state:
|
|
@@ -1,145 +1,182 @@
|
|
|
1
|
-
# GitPush Tool 🚀
|
|
2
|
-
|
|
3
|
-
[](https://pypi.org/project/gitpush-tool/)
|
|
4
|
-
[](LICENSE)
|
|
5
|
-
|
|
6
|
-
A supercharged Git CLI and safety tool that simplifies repository creation and pushing with intelligent defaults, rich pre-push diffstat inspection (`+++---` lines), and active safeguards against dangerous Git commands.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## ✨ Features
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
# GitPush Tool 🚀
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/gitpush-tool/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
A supercharged Git CLI and safety tool that simplifies repository creation and pushing with intelligent defaults, rich pre-push diffstat inspection (`+++---` lines), and active safeguards against dangerous Git commands.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ✨ Features
|
|
11
|
+
|
|
12
|
+
- **Decision-Support Status Dashboard (`gitpush status`):** Actionable repository overview showing worktree breakdown, commit sync, intelligent next-step recommendations, and a 0-100 Repo Health score.
|
|
13
|
+
- **Pre-Push Safety & Diffstat Preview:** See changed files, line additions/deletions (`+X, -Y`), ahead/behind status, and pending commits before pushing.
|
|
14
|
+
- **Dangerous Git Operation Guard:** Analyzes and protects against risky actions (`reset --hard`, force pushes, deleting unmerged branches, dirty `git clean`, detached HEADs).
|
|
15
|
+
- **Protected Branch Safeguard:** Automatically detects and alerts when pushing or force-pushing to `main`, `master`, `prod`, `release`, or `dev`.
|
|
16
|
+
- **One-Command GitHub Repo Creation:** Initialize Git, create a remote GitHub repo, and push in a single step via GitHub CLI (`gh`).
|
|
17
|
+
- **Safe Force Pushing:** Uses `--force-with-lease` by default to avoid overwriting teammate commits.
|
|
18
|
+
- **Dry-Run Mode:** Preview your push inspection without modifying anything.
|
|
19
|
+
- **Non-Interactive & CI Friendly:** Skip prompts with `-y` or `--yes`.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📦 Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install gitpush-tool
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 📊 Decision-Support Status Dashboard (`gitpush status`)
|
|
32
|
+
|
|
33
|
+
Instead of raw, cryptic Git output, `gitpush status` gives you structured decision support:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
Repository: my-project
|
|
37
|
+
Branch: feature/payment
|
|
38
|
+
Tracking: origin/feature/payment
|
|
39
|
+
|
|
40
|
+
WORKTREE
|
|
41
|
+
────────────────────────
|
|
42
|
+
Modified 4
|
|
43
|
+
Added 2
|
|
44
|
+
Deleted 1
|
|
45
|
+
Untracked 3
|
|
46
|
+
Line Changes +142, -18
|
|
47
|
+
|
|
48
|
+
COMMITS
|
|
49
|
+
────────────────────────
|
|
50
|
+
Ahead 3
|
|
51
|
+
Behind 1
|
|
52
|
+
|
|
53
|
+
PUSH / STATUS
|
|
54
|
+
────────────────────────
|
|
55
|
+
⚠ Remote has 1 commit(s) you don't have locally.
|
|
56
|
+
|
|
57
|
+
Recommended:
|
|
58
|
+
git pull --rebase
|
|
59
|
+
gitpush "Commit message"
|
|
60
|
+
|
|
61
|
+
Health:
|
|
62
|
+
82/100 [████████░░] Good (Minor Action Needed)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🛡️ Pre-Push Warning & Inspection
|
|
68
|
+
|
|
69
|
+
Whenever you run `gitpush`, you get an instant, clear breakdown of your repository state:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
═══════════════════════════════════════════════════════════════
|
|
73
|
+
🚀 GITPUSH PRE-PUSH INSPECTION & SUMMARY
|
|
74
|
+
═══════════════════════════════════════════════════════════════
|
|
75
|
+
|
|
76
|
+
Repository: my-project (/Users/username/Projects/my-project)
|
|
77
|
+
Target Branch: main ⚠️ [PROTECTED BRANCH] ──> origin/main
|
|
78
|
+
Sync Status: Ahead: 2 commit(s), Behind: 0 commit(s)
|
|
79
|
+
Action: Commit: 'Add user authentication flow'
|
|
80
|
+
|
|
81
|
+
Warnings:
|
|
82
|
+
⚠️ Pushing directly to protected branch 'main'.
|
|
83
|
+
|
|
84
|
+
Changed Files (3 file(s), +84 / -12):
|
|
85
|
+
M src/auth.py (+65, -8)
|
|
86
|
+
M README.md (+19, -4)
|
|
87
|
+
?? config/auth.json (+12 lines, untracked)
|
|
88
|
+
|
|
89
|
+
Pending Commits to Push (2):
|
|
90
|
+
• 8f3d1a2 Initial auth scaffold
|
|
91
|
+
• 4e9c7b1 Implement JWT token verification
|
|
92
|
+
═══════════════════════════════════════════════════════════════
|
|
93
|
+
|
|
94
|
+
Continue? [y/N]:
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 🛑 Dangerous Command Guard
|
|
100
|
+
|
|
101
|
+
Use `gitpush guard <command>` (or `gitpush-guard <command>`) before executing risky Git operations:
|
|
102
|
+
|
|
103
|
+
### 1. Hard Reset (`reset --hard`)
|
|
104
|
+
Detects uncommitted modifications and unlinked commits before you lose them:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
Command: [WARNING ⚠️]
|
|
108
|
+
git reset --hard HEAD~5
|
|
109
|
+
|
|
110
|
+
Changes that may be lost:
|
|
111
|
+
5 commit(s)
|
|
112
|
+
12 modified/staged file(s)
|
|
113
|
+
|
|
114
|
+
Risks & Warnings:
|
|
115
|
+
⚠️ All uncommitted changes in tracked files will be permanently discarded.
|
|
116
|
+
⚠️ 12 uncommitted modified/staged file(s) will be lost immediately.
|
|
117
|
+
⚠️ 5 commit(s) will be unlinked from current branch HEAD.
|
|
118
|
+
|
|
119
|
+
Commits that will become unreachable:
|
|
120
|
+
• cbc4db7 Add billing webhooks
|
|
121
|
+
• 02bd1c5 Update stripe integration
|
|
122
|
+
• 9033dd9 Fix invoice generator
|
|
123
|
+
• a8eb29a Refactor customer portal
|
|
124
|
+
• 97fd9b4 Update dependencies
|
|
125
|
+
|
|
126
|
+
Repository:
|
|
127
|
+
my-project
|
|
128
|
+
|
|
129
|
+
Continue? [y/N]:
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 2. Guard Detects:
|
|
133
|
+
- **`reset --hard`**: Identifies uncommitted files and commits that will be orphaned.
|
|
134
|
+
- **`force push`**: Detects remote overwrite risks and protected branch overrides.
|
|
135
|
+
- **`deleting branches`**: Identifies unmerged commits that would be lost.
|
|
136
|
+
- **`cleaning untracked files`**: Warns of files/directories `git clean -fd` will permanently delete.
|
|
137
|
+
- **`checkout / restore`**: Flags uncommitted modifications about to be discarded.
|
|
138
|
+
- **`rebasing with uncommitted work`**: Warns of dirty working trees before rebase conflicts occur.
|
|
139
|
+
- **`pushing to protected branches`**: Direct pushes to `main`, `master`, `prod`, `dev`, etc.
|
|
140
|
+
- **`detached HEAD situations`**: Warns when working or committing on detached HEADs.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 🛠️ Usage & Commands
|
|
145
|
+
|
|
146
|
+
| Command | Description |
|
|
147
|
+
|---|---|
|
|
148
|
+
| `gitpush "Commit message"` | Stages all changes, previews diffs, commits, and pushes. |
|
|
149
|
+
| `gitpush` | Pushes staged/unpushed changes with safety preview. |
|
|
150
|
+
| `gitpush -y` | Pushes immediately without confirmation prompt. |
|
|
151
|
+
| `gitpush --dry-run` | Shows the pre-push inspection and exits without changes. |
|
|
152
|
+
| `gitpush --force` | Safe force push using `--force-with-lease`. |
|
|
153
|
+
| `gitpush --tags` | Pushes all local tags. |
|
|
154
|
+
| `gitpush guard <git command>` | Inspects and guards any dangerous Git command. |
|
|
155
|
+
| `gitpush --init` | Initializes Git repo and creates default `.gitignore`. |
|
|
156
|
+
| `gitpush --new-repo <name>` | Creates a new GitHub repo and pushes in one step. |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🧠 New Repository Workflow
|
|
161
|
+
|
|
162
|
+
Create and publish a repository to GitHub in a single command:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Public repo
|
|
166
|
+
gitpush "Initial commit" --new-repo my-awesome-project
|
|
167
|
+
|
|
168
|
+
# Private repo with description
|
|
169
|
+
gitpush "Initial commit" --new-repo secret-app --private --description "Internal tool"
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 🤝 Contributing
|
|
175
|
+
|
|
176
|
+
Contributions are welcome! Please feel free to open issues or submit pull requests on [GitHub](https://github.com/inevitablegs/gitpush).
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 📄 License
|
|
181
|
+
|
|
182
|
+
MIT © [Ganesh Sonawane](https://github.com/inevitablegs)
|