https://github.com/basameera/egit
Easy Git wrapper using Python 3
https://github.com/basameera/egit
easygit git python
Last synced: 2 months ago
JSON representation
Easy Git wrapper using Python 3
- Host: GitHub
- URL: https://github.com/basameera/egit
- Owner: basameera
- License: mit
- Created: 2020-04-29T20:29:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T13:24:03.000Z (almost 2 years ago)
- Last Synced: 2025-03-29T07:45:34.570Z (over 1 year ago)
- Topics: easygit, git, python
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# egit
Python module for handling git easy.
## Features
* **Smart git fetch**
**Only Python 3**
**Module can be accessed using both `eg` and `egit` commands**
``` bash
$ eg -h
usage:
egit : Git status
egit comment : Git add, commit (with "comment") and push
egit -a : Git Add -A
egit -c comment : Git Commit -m comment
egit -p : Git Push
egit -u : Git Pull
egit -b : Change branch
Easy Git - 0.1.1 | 2020 Sameera Sandaruwan
positional arguments:
comment
optional arguments:
-h, --help show this help message and exit
-a Git Add -A
-c Git Commit -m comment
-p Git Push
-u Git Pull
-b Change branch
-s git-credential-cache for 3 hours
```
## Install
1. Clone this repo. ( `git clone https://github.com/basameera/egit.git` )
1. `cd egit`
1. `pip3 install .`
1. Add `export PATH=~/.local/bin:$PATH` to `~/.bashrc` file
1. `source ~/.bashrc`
**Git fetch**
```
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
echo LOCAL : $LOCAL
echo REMOTE: $REMOTE
echo BASE : $BASE
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
elif [ $LOCAL = $BASE ]; then
echo "Need to pull"
elif [ $REMOTE = $BASE ]; then
echo "Need to push"
else
echo "Diverged"
fi
```