Coder Social home page Coder Social logo

gscp's Introduction

gscp: Git, Stage all, Commit, Push

I often find myself writing a bunch of code and wanting to commit it all, in one singular command. It's not very hard:

$ git add -u
$ git commit -v
$ git push

However, this is two commands two long. This should be in a singular command! This is why I once had a gscp script in $PATH that did pretty much that. However, I wanted to add features over time:

  • The ability to specify a commit message (sometimes)
  • The ability to force push
  • The ability to create amend commits
  • And maybe more

It would have been easy enough to have those features in my shell script, but parsing the flags in shell seemed harder than it needs to be. Therefore, I created a python package. Yay python!

Installation

> pip install gscp

Requirements

This is a rather simple script. It requires python 3.7 or higher. Because it uses git, you obviously need to have git in path. It relies on the pty module. If the pty module is limited in some OSes, those limits apply here. All the other requirements are in pyproject.toml.

Building / Running

This project is built with poetry.

Usage:

usage: gscp [-h] [-a] [-f] [message]

positional arguments:
  message      Commit message to use. If no message specified, it falls back to git's default behaviour with verbose mode

options:
  -h, --help   show this help message and exit
  -a, --amend  If we using git amend mode (warning, this triggers a force push)
  -f, --force  If we use `git push --force`

Disclaimer

Use at your own risk. This can force push stuff, after all.

gscp's People

Contributors

samuelyvon avatar

Stargazers

Selim Belhaouane avatar  avatar

Watchers

 avatar

Forkers

selimb

gscp's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.