gitpush-tool 0.1.0__tar.gz → 0.1.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.1.2/PKG-INFO +164 -0
- gitpush_tool-0.1.2/README.md +139 -0
- gitpush_tool-0.1.2/gitpush_tool/__init__.py +1 -0
- gitpush_tool-0.1.2/gitpush_tool/cli.py +104 -0
- gitpush_tool-0.1.2/gitpush_tool.egg-info/PKG-INFO +164 -0
- gitpush_tool-0.1.2/gitpush_tool.egg-info/entry_points.txt +2 -0
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/setup.py +6 -6
- gitpush_tool-0.1.0/PKG-INFO +0 -33
- gitpush_tool-0.1.0/README.md +0 -8
- gitpush_tool-0.1.0/gitpush_tool/__init__.py +0 -1
- gitpush_tool-0.1.0/gitpush_tool/cli.py +0 -15
- gitpush_tool-0.1.0/gitpush_tool.egg-info/PKG-INFO +0 -33
- gitpush_tool-0.1.0/gitpush_tool.egg-info/entry_points.txt +0 -2
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/LICENSE +0 -0
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/MANIFEST.in +0 -0
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/gitpush_tool.egg-info/SOURCES.txt +0 -0
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/gitpush_tool.egg-info/dependency_links.txt +0 -0
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/gitpush_tool.egg-info/top_level.txt +0 -0
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/pyproject.toml +0 -0
- {gitpush_tool-0.1.0 → gitpush_tool-0.1.2}/setup.cfg +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitpush-tool
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A CLI tool to simplify Git push operations with intelligent defaults and options.
|
|
5
|
+
Home-page: https://github.com/yourusername/gitpush_tool
|
|
6
|
+
Author: Ganesh Sonawane
|
|
7
|
+
Author-email: sonawaneganu3101@example.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.6
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: license
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
# `gitpush_tool`
|
|
27
|
+
|
|
28
|
+
[](https://github.com/your-username/gitpush_tool/actions/workflows/main.yml)
|
|
29
|
+
[](https://pypi.org/project/gitpush_tool/)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
|
|
32
|
+
## About `gitpush_tool`
|
|
33
|
+
|
|
34
|
+
`gitpush_tool` is a lightweight yet powerful command-line utility designed to streamline and simplify your Git push operations. In the fast-paced world of software development, repetitive or complex Git commands can hinder productivity. This tool aims to alleviate that by providing an intuitive interface and potentially advanced functionalities to manage your code pushes with greater ease and efficiency.
|
|
35
|
+
|
|
36
|
+
Whether you're a seasoned developer managing multiple branches and remotes or a newcomer looking for a more forgiving way to interact with Git's push command, `gitpush_tool` offers a refined experience. It abstracts away some of the complexities of `git push`, allowing you to focus more on your code and less on command-line intricacies, ultimately enhancing your daily development workflow.
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
* **Simplified Push Operations**: Execute common Git push commands with a more concise and user-friendly syntax.
|
|
41
|
+
* **Intelligent Defaults**: Potentially intelligent defaulting for common push scenarios (e.g., current branch, upstream remote).
|
|
42
|
+
* **Enhanced Workflow**: Designed to reduce keystrokes and potential errors during frequent push operations.
|
|
43
|
+
* **Python-based**: Easily installable and extensible within the Python ecosystem.
|
|
44
|
+
* **Lightweight**: Minimal dependencies, ensuring a small footprint and fast execution.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
`gitpush_tool` is a Python package and can be easily installed using `pip`.
|
|
49
|
+
|
|
50
|
+
### Using `pip` (Recommended)
|
|
51
|
+
|
|
52
|
+
To install the latest stable version from PyPI:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install gitpush_tool
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### From Source
|
|
59
|
+
|
|
60
|
+
If you want to install the latest development version or contribute to the project, you can install it directly from the source:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/your-username/gitpush_tool.git
|
|
64
|
+
cd gitpush_tool
|
|
65
|
+
pip install .
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For development purposes, you might want to install it in editable mode:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install -e .
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
Once installed, `gitpush_tool` can be invoked from your terminal. Its primary purpose is to simplify the `git push` command. The exact arguments and behaviors will depend on the tool's implementation, but here are some illustrative examples based on common Git push patterns:
|
|
77
|
+
|
|
78
|
+
### Basic Push
|
|
79
|
+
|
|
80
|
+
To push your current branch to its configured upstream remote:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
gitpush_tool
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Pushing a Specific Branch
|
|
87
|
+
|
|
88
|
+
To push a specific local branch (`feature/xyz`) to its default remote:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
gitpush_tool feature/xyz
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Pushing to a Specific Remote and Branch
|
|
95
|
+
|
|
96
|
+
To push your current branch to a specific remote (`origin`) and branch (`main`):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
gitpush_tool origin main
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Force Push (with caution!)
|
|
103
|
+
|
|
104
|
+
To perform a force push (e.g., using `--force-with-lease` for safety):
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
gitpush_tool --force
|
|
108
|
+
# or, if the tool provides a safer alias
|
|
109
|
+
gitpush_tool --force-lease
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Pushing Tags
|
|
113
|
+
|
|
114
|
+
To push all local tags:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
gitpush_tool --tags
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Creating and Pushing to a New GitHub Repository
|
|
121
|
+
|
|
122
|
+
To create a new GitHub repository and push your code in one command:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
gitpush_tool "Initial commit" --new-repo my-new-repo --description "My awesome project"
|
|
126
|
+
|
|
127
|
+
### Help
|
|
128
|
+
|
|
129
|
+
To view all available commands and options:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
gitpush_tool --help
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
*Note: The actual commands and their effects depend on the specific logic implemented within `gitpush_tool/cli.py`. Please refer to the tool's `--help` output for precise usage details.*
|
|
136
|
+
|
|
137
|
+
## Configuration
|
|
138
|
+
|
|
139
|
+
`gitpush_tool` primarily relies on command-line arguments for its operation. Based on the project analysis, there are no specific user-facing configuration files (like `.gitpushrc` or similar) detected that would require manual editing by the user for runtime behavior. `pyproject.toml` and `setup.py` are used for project building and packaging, not for end-user runtime configuration.
|
|
140
|
+
|
|
141
|
+
Any configuration or default behaviors would typically be set through environmental variables or command-line flags. Consult the `--help` output for any such options.
|
|
142
|
+
|
|
143
|
+
## API Documentation
|
|
144
|
+
|
|
145
|
+
`gitpush_tool` is designed as a command-line interface (CLI) tool for direct user interaction. It is not intended to be used as a Python library with an exposed API for import into other Python projects. Its functionality is accessible exclusively via the terminal.
|
|
146
|
+
|
|
147
|
+
## Contributing
|
|
148
|
+
|
|
149
|
+
We welcome contributions to `gitpush_tool`! If you have suggestions for improvements, bug reports, or want to contribute code, please follow these steps:
|
|
150
|
+
|
|
151
|
+
1. **Fork** the repository on GitHub.
|
|
152
|
+
2. **Clone** your forked repository: `git clone https://github.com/your-username/gitpush_tool.git`
|
|
153
|
+
3. **Create a new branch**: `git checkout -b feature/your-feature-name` or `bugfix/issue-description`
|
|
154
|
+
4. **Make your changes**.
|
|
155
|
+
5. **Test your changes** thoroughly.
|
|
156
|
+
6. **Commit your changes**: `git commit -m "feat: Add new awesome feature"` (please use conventional commits if possible).
|
|
157
|
+
7. **Push to your branch**: `git push origin feature/your-feature-name`
|
|
158
|
+
8. **Open a Pull Request** against the `main` branch of the original repository.
|
|
159
|
+
|
|
160
|
+
Please ensure your code adheres to good coding practices and includes relevant tests.
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# `gitpush_tool`
|
|
2
|
+
|
|
3
|
+
[](https://github.com/your-username/gitpush_tool/actions/workflows/main.yml)
|
|
4
|
+
[](https://pypi.org/project/gitpush_tool/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
## About `gitpush_tool`
|
|
8
|
+
|
|
9
|
+
`gitpush_tool` is a lightweight yet powerful command-line utility designed to streamline and simplify your Git push operations. In the fast-paced world of software development, repetitive or complex Git commands can hinder productivity. This tool aims to alleviate that by providing an intuitive interface and potentially advanced functionalities to manage your code pushes with greater ease and efficiency.
|
|
10
|
+
|
|
11
|
+
Whether you're a seasoned developer managing multiple branches and remotes or a newcomer looking for a more forgiving way to interact with Git's push command, `gitpush_tool` offers a refined experience. It abstracts away some of the complexities of `git push`, allowing you to focus more on your code and less on command-line intricacies, ultimately enhancing your daily development workflow.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
* **Simplified Push Operations**: Execute common Git push commands with a more concise and user-friendly syntax.
|
|
16
|
+
* **Intelligent Defaults**: Potentially intelligent defaulting for common push scenarios (e.g., current branch, upstream remote).
|
|
17
|
+
* **Enhanced Workflow**: Designed to reduce keystrokes and potential errors during frequent push operations.
|
|
18
|
+
* **Python-based**: Easily installable and extensible within the Python ecosystem.
|
|
19
|
+
* **Lightweight**: Minimal dependencies, ensuring a small footprint and fast execution.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
`gitpush_tool` is a Python package and can be easily installed using `pip`.
|
|
24
|
+
|
|
25
|
+
### Using `pip` (Recommended)
|
|
26
|
+
|
|
27
|
+
To install the latest stable version from PyPI:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install gitpush_tool
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### From Source
|
|
34
|
+
|
|
35
|
+
If you want to install the latest development version or contribute to the project, you can install it directly from the source:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/your-username/gitpush_tool.git
|
|
39
|
+
cd gitpush_tool
|
|
40
|
+
pip install .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For development purposes, you might want to install it in editable mode:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install -e .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
Once installed, `gitpush_tool` can be invoked from your terminal. Its primary purpose is to simplify the `git push` command. The exact arguments and behaviors will depend on the tool's implementation, but here are some illustrative examples based on common Git push patterns:
|
|
52
|
+
|
|
53
|
+
### Basic Push
|
|
54
|
+
|
|
55
|
+
To push your current branch to its configured upstream remote:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
gitpush_tool
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Pushing a Specific Branch
|
|
62
|
+
|
|
63
|
+
To push a specific local branch (`feature/xyz`) to its default remote:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
gitpush_tool feature/xyz
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Pushing to a Specific Remote and Branch
|
|
70
|
+
|
|
71
|
+
To push your current branch to a specific remote (`origin`) and branch (`main`):
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
gitpush_tool origin main
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Force Push (with caution!)
|
|
78
|
+
|
|
79
|
+
To perform a force push (e.g., using `--force-with-lease` for safety):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
gitpush_tool --force
|
|
83
|
+
# or, if the tool provides a safer alias
|
|
84
|
+
gitpush_tool --force-lease
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Pushing Tags
|
|
88
|
+
|
|
89
|
+
To push all local tags:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
gitpush_tool --tags
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Creating and Pushing to a New GitHub Repository
|
|
96
|
+
|
|
97
|
+
To create a new GitHub repository and push your code in one command:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
gitpush_tool "Initial commit" --new-repo my-new-repo --description "My awesome project"
|
|
101
|
+
|
|
102
|
+
### Help
|
|
103
|
+
|
|
104
|
+
To view all available commands and options:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
gitpush_tool --help
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
*Note: The actual commands and their effects depend on the specific logic implemented within `gitpush_tool/cli.py`. Please refer to the tool's `--help` output for precise usage details.*
|
|
111
|
+
|
|
112
|
+
## Configuration
|
|
113
|
+
|
|
114
|
+
`gitpush_tool` primarily relies on command-line arguments for its operation. Based on the project analysis, there are no specific user-facing configuration files (like `.gitpushrc` or similar) detected that would require manual editing by the user for runtime behavior. `pyproject.toml` and `setup.py` are used for project building and packaging, not for end-user runtime configuration.
|
|
115
|
+
|
|
116
|
+
Any configuration or default behaviors would typically be set through environmental variables or command-line flags. Consult the `--help` output for any such options.
|
|
117
|
+
|
|
118
|
+
## API Documentation
|
|
119
|
+
|
|
120
|
+
`gitpush_tool` is designed as a command-line interface (CLI) tool for direct user interaction. It is not intended to be used as a Python library with an exposed API for import into other Python projects. Its functionality is accessible exclusively via the terminal.
|
|
121
|
+
|
|
122
|
+
## Contributing
|
|
123
|
+
|
|
124
|
+
We welcome contributions to `gitpush_tool`! If you have suggestions for improvements, bug reports, or want to contribute code, please follow these steps:
|
|
125
|
+
|
|
126
|
+
1. **Fork** the repository on GitHub.
|
|
127
|
+
2. **Clone** your forked repository: `git clone https://github.com/your-username/gitpush_tool.git`
|
|
128
|
+
3. **Create a new branch**: `git checkout -b feature/your-feature-name` or `bugfix/issue-description`
|
|
129
|
+
4. **Make your changes**.
|
|
130
|
+
5. **Test your changes** thoroughly.
|
|
131
|
+
6. **Commit your changes**: `git commit -m "feat: Add new awesome feature"` (please use conventional commits if possible).
|
|
132
|
+
7. **Push to your branch**: `git push origin feature/your-feature-name`
|
|
133
|
+
8. **Open a Pull Request** against the `main` branch of the original repository.
|
|
134
|
+
|
|
135
|
+
Please ensure your code adheres to good coding practices and includes relevant tests.
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.2"
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import argparse
|
|
3
|
+
import sys
|
|
4
|
+
import requests
|
|
5
|
+
from getpass import getpass
|
|
6
|
+
|
|
7
|
+
def create_github_repo(repo_name, private=False, description=""):
|
|
8
|
+
"""Create a new GitHub repository using the GitHub API"""
|
|
9
|
+
# Get GitHub token from environment or prompt
|
|
10
|
+
token = os.getenv("GITHUB_TOKEN")
|
|
11
|
+
if not token:
|
|
12
|
+
token_path = os.path.join(os.path.dirname(__file__), '..', 'token')
|
|
13
|
+
if os.path.exists(token_path):
|
|
14
|
+
with open(token_path, 'r') as f:
|
|
15
|
+
token = f.read().strip()
|
|
16
|
+
else:
|
|
17
|
+
token = getpass("Enter your GitHub personal access token: ")
|
|
18
|
+
|
|
19
|
+
headers = {
|
|
20
|
+
"Authorization": f"token {token}",
|
|
21
|
+
"Accept": "application/vnd.github.v3+json"
|
|
22
|
+
}
|
|
23
|
+
data = {
|
|
24
|
+
"name": repo_name,
|
|
25
|
+
"description": description,
|
|
26
|
+
"private": private,
|
|
27
|
+
"auto_init": False
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try:
|
|
31
|
+
response = requests.post(
|
|
32
|
+
"https://api.github.com/user/repos",
|
|
33
|
+
headers=headers,
|
|
34
|
+
json=data
|
|
35
|
+
)
|
|
36
|
+
response.raise_for_status()
|
|
37
|
+
return response.json()["html_url"]
|
|
38
|
+
except requests.exceptions.RequestException as e:
|
|
39
|
+
print(f"❌ Failed to create repository: {e}")
|
|
40
|
+
return None
|
|
41
|
+
|
|
42
|
+
def run():
|
|
43
|
+
parser = argparse.ArgumentParser(
|
|
44
|
+
description="📦 Simple CLI to automate git operations and GitHub repository creation."
|
|
45
|
+
)
|
|
46
|
+
parser.add_argument("commit", nargs="?", help="Commit message. If omitted, no commit will be made.")
|
|
47
|
+
parser.add_argument("branch", nargs="?", default="main", help="Branch to push to (default: main).")
|
|
48
|
+
parser.add_argument("remote", nargs="?", default="origin", help="Remote name (default: origin).")
|
|
49
|
+
parser.add_argument("--force", action="store_true", help="Force push (use with caution).")
|
|
50
|
+
parser.add_argument("--tags", action="store_true", help="Push all local tags.")
|
|
51
|
+
parser.add_argument("--init", action="store_true", help="Run 'git init' before pushing.")
|
|
52
|
+
parser.add_argument("--new-repo", metavar="REPO_NAME", help="Create a new GitHub repository with this name.")
|
|
53
|
+
parser.add_argument("--private", action="store_true", help="Make the new repository private.")
|
|
54
|
+
parser.add_argument("--description", help="Description for the new repository.")
|
|
55
|
+
|
|
56
|
+
args = parser.parse_args()
|
|
57
|
+
|
|
58
|
+
# Create new GitHub repository if requested
|
|
59
|
+
if args.new_repo:
|
|
60
|
+
print(f"🆕 Creating new GitHub repository: {args.new_repo}")
|
|
61
|
+
repo_url = create_github_repo(
|
|
62
|
+
args.new_repo,
|
|
63
|
+
private=args.private,
|
|
64
|
+
description=args.description or ""
|
|
65
|
+
)
|
|
66
|
+
if not repo_url:
|
|
67
|
+
sys.exit(1)
|
|
68
|
+
|
|
69
|
+
print(f"✅ Repository created: {repo_url}")
|
|
70
|
+
|
|
71
|
+
# Initialize git if not already a repo
|
|
72
|
+
if not os.path.exists(".git"):
|
|
73
|
+
args.init = True
|
|
74
|
+
|
|
75
|
+
# Set up git remote
|
|
76
|
+
os.system(f"git remote add {args.remote} {repo_url}")
|
|
77
|
+
|
|
78
|
+
if args.init:
|
|
79
|
+
print("🛠 Initializing git repository...")
|
|
80
|
+
os.system("git init")
|
|
81
|
+
|
|
82
|
+
os.system("git add .")
|
|
83
|
+
|
|
84
|
+
if args.commit:
|
|
85
|
+
print(f"📦 Committing with message: '{args.commit}'")
|
|
86
|
+
os.system(f'git commit -m "{args.commit}"')
|
|
87
|
+
else:
|
|
88
|
+
print("⚠️ No commit message provided. Skipping commit step.")
|
|
89
|
+
|
|
90
|
+
push_cmd = "git push"
|
|
91
|
+
|
|
92
|
+
if args.force:
|
|
93
|
+
push_cmd += " --force-with-lease"
|
|
94
|
+
|
|
95
|
+
if args.tags:
|
|
96
|
+
push_cmd += " --tags"
|
|
97
|
+
|
|
98
|
+
if args.remote and args.branch:
|
|
99
|
+
push_cmd += f" {args.remote} {args.branch}"
|
|
100
|
+
elif args.branch:
|
|
101
|
+
push_cmd += f" origin {args.branch}"
|
|
102
|
+
|
|
103
|
+
print(f"🚀 Running: {push_cmd}")
|
|
104
|
+
os.system(push_cmd)
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitpush-tool
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A CLI tool to simplify Git push operations with intelligent defaults and options.
|
|
5
|
+
Home-page: https://github.com/yourusername/gitpush_tool
|
|
6
|
+
Author: Ganesh Sonawane
|
|
7
|
+
Author-email: sonawaneganu3101@example.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.6
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: license
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
# `gitpush_tool`
|
|
27
|
+
|
|
28
|
+
[](https://github.com/your-username/gitpush_tool/actions/workflows/main.yml)
|
|
29
|
+
[](https://pypi.org/project/gitpush_tool/)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
|
|
32
|
+
## About `gitpush_tool`
|
|
33
|
+
|
|
34
|
+
`gitpush_tool` is a lightweight yet powerful command-line utility designed to streamline and simplify your Git push operations. In the fast-paced world of software development, repetitive or complex Git commands can hinder productivity. This tool aims to alleviate that by providing an intuitive interface and potentially advanced functionalities to manage your code pushes with greater ease and efficiency.
|
|
35
|
+
|
|
36
|
+
Whether you're a seasoned developer managing multiple branches and remotes or a newcomer looking for a more forgiving way to interact with Git's push command, `gitpush_tool` offers a refined experience. It abstracts away some of the complexities of `git push`, allowing you to focus more on your code and less on command-line intricacies, ultimately enhancing your daily development workflow.
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
* **Simplified Push Operations**: Execute common Git push commands with a more concise and user-friendly syntax.
|
|
41
|
+
* **Intelligent Defaults**: Potentially intelligent defaulting for common push scenarios (e.g., current branch, upstream remote).
|
|
42
|
+
* **Enhanced Workflow**: Designed to reduce keystrokes and potential errors during frequent push operations.
|
|
43
|
+
* **Python-based**: Easily installable and extensible within the Python ecosystem.
|
|
44
|
+
* **Lightweight**: Minimal dependencies, ensuring a small footprint and fast execution.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
`gitpush_tool` is a Python package and can be easily installed using `pip`.
|
|
49
|
+
|
|
50
|
+
### Using `pip` (Recommended)
|
|
51
|
+
|
|
52
|
+
To install the latest stable version from PyPI:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install gitpush_tool
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### From Source
|
|
59
|
+
|
|
60
|
+
If you want to install the latest development version or contribute to the project, you can install it directly from the source:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/your-username/gitpush_tool.git
|
|
64
|
+
cd gitpush_tool
|
|
65
|
+
pip install .
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For development purposes, you might want to install it in editable mode:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install -e .
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
Once installed, `gitpush_tool` can be invoked from your terminal. Its primary purpose is to simplify the `git push` command. The exact arguments and behaviors will depend on the tool's implementation, but here are some illustrative examples based on common Git push patterns:
|
|
77
|
+
|
|
78
|
+
### Basic Push
|
|
79
|
+
|
|
80
|
+
To push your current branch to its configured upstream remote:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
gitpush_tool
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Pushing a Specific Branch
|
|
87
|
+
|
|
88
|
+
To push a specific local branch (`feature/xyz`) to its default remote:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
gitpush_tool feature/xyz
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Pushing to a Specific Remote and Branch
|
|
95
|
+
|
|
96
|
+
To push your current branch to a specific remote (`origin`) and branch (`main`):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
gitpush_tool origin main
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Force Push (with caution!)
|
|
103
|
+
|
|
104
|
+
To perform a force push (e.g., using `--force-with-lease` for safety):
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
gitpush_tool --force
|
|
108
|
+
# or, if the tool provides a safer alias
|
|
109
|
+
gitpush_tool --force-lease
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Pushing Tags
|
|
113
|
+
|
|
114
|
+
To push all local tags:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
gitpush_tool --tags
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Creating and Pushing to a New GitHub Repository
|
|
121
|
+
|
|
122
|
+
To create a new GitHub repository and push your code in one command:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
gitpush_tool "Initial commit" --new-repo my-new-repo --description "My awesome project"
|
|
126
|
+
|
|
127
|
+
### Help
|
|
128
|
+
|
|
129
|
+
To view all available commands and options:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
gitpush_tool --help
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
*Note: The actual commands and their effects depend on the specific logic implemented within `gitpush_tool/cli.py`. Please refer to the tool's `--help` output for precise usage details.*
|
|
136
|
+
|
|
137
|
+
## Configuration
|
|
138
|
+
|
|
139
|
+
`gitpush_tool` primarily relies on command-line arguments for its operation. Based on the project analysis, there are no specific user-facing configuration files (like `.gitpushrc` or similar) detected that would require manual editing by the user for runtime behavior. `pyproject.toml` and `setup.py` are used for project building and packaging, not for end-user runtime configuration.
|
|
140
|
+
|
|
141
|
+
Any configuration or default behaviors would typically be set through environmental variables or command-line flags. Consult the `--help` output for any such options.
|
|
142
|
+
|
|
143
|
+
## API Documentation
|
|
144
|
+
|
|
145
|
+
`gitpush_tool` is designed as a command-line interface (CLI) tool for direct user interaction. It is not intended to be used as a Python library with an exposed API for import into other Python projects. Its functionality is accessible exclusively via the terminal.
|
|
146
|
+
|
|
147
|
+
## Contributing
|
|
148
|
+
|
|
149
|
+
We welcome contributions to `gitpush_tool`! If you have suggestions for improvements, bug reports, or want to contribute code, please follow these steps:
|
|
150
|
+
|
|
151
|
+
1. **Fork** the repository on GitHub.
|
|
152
|
+
2. **Clone** your forked repository: `git clone https://github.com/your-username/gitpush_tool.git`
|
|
153
|
+
3. **Create a new branch**: `git checkout -b feature/your-feature-name` or `bugfix/issue-description`
|
|
154
|
+
4. **Make your changes**.
|
|
155
|
+
5. **Test your changes** thoroughly.
|
|
156
|
+
6. **Commit your changes**: `git commit -m "feat: Add new awesome feature"` (please use conventional commits if possible).
|
|
157
|
+
7. **Push to your branch**: `git push origin feature/your-feature-name`
|
|
158
|
+
8. **Open a Pull Request** against the `main` branch of the original repository.
|
|
159
|
+
|
|
160
|
+
Please ensure your code adheres to good coding practices and includes relevant tests.
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -2,21 +2,21 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
setup(
|
|
5
|
-
name="gitpush-tool",
|
|
6
|
-
version="0.1.
|
|
5
|
+
name="gitpush-tool",
|
|
6
|
+
version="0.1.2",
|
|
7
7
|
packages=find_packages(),
|
|
8
8
|
install_requires=[],
|
|
9
9
|
entry_points={
|
|
10
10
|
"console_scripts": [
|
|
11
|
-
"
|
|
11
|
+
"gitpush_tool=gitpush_tool.cli:run"
|
|
12
12
|
],
|
|
13
13
|
},
|
|
14
14
|
author="Ganesh Sonawane",
|
|
15
15
|
author_email="sonawaneganu3101@example.com",
|
|
16
|
-
description="A
|
|
16
|
+
description="A CLI tool to simplify Git push operations with intelligent defaults and options.",
|
|
17
17
|
long_description=Path("README.md").read_text(encoding="utf-8"),
|
|
18
18
|
long_description_content_type="text/markdown",
|
|
19
|
-
url="https://github.com/yourusername/
|
|
19
|
+
url="https://github.com/yourusername/gitpush_tool",
|
|
20
20
|
license="MIT",
|
|
21
21
|
classifiers=[
|
|
22
22
|
"Programming Language :: Python :: 3",
|
|
@@ -24,4 +24,4 @@ setup(
|
|
|
24
24
|
"Operating System :: OS Independent",
|
|
25
25
|
],
|
|
26
26
|
python_requires=">=3.6",
|
|
27
|
-
)
|
|
27
|
+
)
|
gitpush_tool-0.1.0/PKG-INFO
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gitpush-tool
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: A simple CLI tool to push git commits with a single command.
|
|
5
|
-
Home-page: https://github.com/yourusername/gitpush
|
|
6
|
-
Author: Ganesh Sonawane
|
|
7
|
-
Author-email: sonawaneganu3101@example.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python: >=3.6
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Dynamic: author
|
|
16
|
-
Dynamic: author-email
|
|
17
|
-
Dynamic: classifier
|
|
18
|
-
Dynamic: description
|
|
19
|
-
Dynamic: description-content-type
|
|
20
|
-
Dynamic: home-page
|
|
21
|
-
Dynamic: license
|
|
22
|
-
Dynamic: license-file
|
|
23
|
-
Dynamic: requires-python
|
|
24
|
-
Dynamic: summary
|
|
25
|
-
|
|
26
|
-
# gitpush_tool
|
|
27
|
-
|
|
28
|
-
[](https://www.python.org/)
|
|
29
|
-
[](LICENSE)
|
|
30
|
-
[](https://github.com/your_username/gitpush_tool/actions)
|
|
31
|
-
[](https://github.com/your_username/gitpush_tool/actions)
|
|
32
|
-
|
|
33
|
-
##
|
gitpush_tool-0.1.0/README.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# gitpush_tool
|
|
2
|
-
|
|
3
|
-
[](https://www.python.org/)
|
|
4
|
-
[](LICENSE)
|
|
5
|
-
[](https://github.com/your_username/gitpush_tool/actions)
|
|
6
|
-
[](https://github.com/your_username/gitpush_tool/actions)
|
|
7
|
-
|
|
8
|
-
##
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.0"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
|
|
4
|
-
def run():
|
|
5
|
-
if len(sys.argv) < 2:
|
|
6
|
-
print("❌ Please provide a commit message.")
|
|
7
|
-
print("✅ Example: gitpush 'Initial commit'")
|
|
8
|
-
sys.exit(1)
|
|
9
|
-
|
|
10
|
-
commit_message = sys.argv[1]
|
|
11
|
-
|
|
12
|
-
os.system("git init")
|
|
13
|
-
os.system("git add .")
|
|
14
|
-
os.system(f'git commit -m "{commit_message}"')
|
|
15
|
-
os.system("git push")
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gitpush-tool
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: A simple CLI tool to push git commits with a single command.
|
|
5
|
-
Home-page: https://github.com/yourusername/gitpush
|
|
6
|
-
Author: Ganesh Sonawane
|
|
7
|
-
Author-email: sonawaneganu3101@example.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python: >=3.6
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Dynamic: author
|
|
16
|
-
Dynamic: author-email
|
|
17
|
-
Dynamic: classifier
|
|
18
|
-
Dynamic: description
|
|
19
|
-
Dynamic: description-content-type
|
|
20
|
-
Dynamic: home-page
|
|
21
|
-
Dynamic: license
|
|
22
|
-
Dynamic: license-file
|
|
23
|
-
Dynamic: requires-python
|
|
24
|
-
Dynamic: summary
|
|
25
|
-
|
|
26
|
-
# gitpush_tool
|
|
27
|
-
|
|
28
|
-
[](https://www.python.org/)
|
|
29
|
-
[](LICENSE)
|
|
30
|
-
[](https://github.com/your_username/gitpush_tool/actions)
|
|
31
|
-
[](https://github.com/your_username/gitpush_tool/actions)
|
|
32
|
-
|
|
33
|
-
##
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|