Code Monkey home page Code Monkey logo

easy-git's Introduction

Easy-Git

Easy Git is a simple tool to help you set up and use your git workspaces.

Easy Git

Getting Started

Introduction

Easy Git is a simple tool to help you set up and use your git workspaces. It is designed to be used with a terminal and is written in zsh. It is a simple script that allows you to set up a git workspace, add or remove worktrees, rebase after a PR merge, and manually add emojis to a local repository.

Prerequisites

  • Git
  • A terminal on zsh preferably, but check the warning below if you use bash

Install

Get into your terminal in your home directory or where you want to install the project (somewhere stable).

cd ~

To install Easy Git, run the following command (at the same level as your .bashrc or .zshrc file):

git clone https://github.com/MorganKryze/Easy-Git.git

Or click on the green "Code" button and download the zip file.

Then, go to the project directory:

cd Easy-Git

You can add the commands to your shell configuration file (e.g. ~/.zshrc). To do so, use the following command:

sh add-commands.sh

You will need to restart your terminal to use the commands below.

Usage

Warning

The script are written for a zsh, if you want to use it with bash, you will have to change the script slightly: Comment the line 111 and uncomment the line 112. The issue comes from the fact that bash and zsh have different syntax for the read command.

Try to run the following command to check that the commands are installed and accessible:

git-help

If you encounter an error, refer to the Troubleshooting section.

Tip

The project uses Git emojis from Buzut. That means that you can use emojis in your commit messages. The script will automatically add the emoji to your commit message if you use the right syntax. For example, if you want to add a "feature" emoji to your commit message, you can write :feat: Add a breaking change feature and the script will automatically replace it with the emoji.

You may now use these commands:

  • git-help: Display the help message.
  • git-setup: Setup a git workspace (clone, add emojis).
  • git-addbranch: Add brand & worktree to a local repository.
  • git-addworktree: Add a worktree to the current repository.
  • git-rmworktree: Remove a worktree from the current repository.
  • git-rebase: Rebase after PR merge (fix the 1 commit ahead and behind) and allow to stash changes.
  • git-addemojis: Manually add emojis to a local repository.

Tip

Always use the git-help command to get the help message and the list of available commands and their needed arguments.

Troubleshooting

If you encounter this error message (or for any command):

zsh: command not found: git-help

You may not have add the path to the easy-git.sh file to your shell configuration file (e.g. ~/.zshrc) or moved the project directory.

Then redo the following command and restart your terminal (or add manually the path to your .zshrc located in ~/.zshrc):

sh add-commands.sh

Project structure

Here are the most important files and directories of the project (you may ignore the other files and directories):

Easy-Git
├── src
│   ├── assets
│   │   └── img
│   │       └── screenshot.png
│   └── easy-git.sh
├── .gitignore
├── add-commands.sh
├── SECURITY
├── CODE_OF_CONDUCT
├── CONTRIBUTING
├── LICENCE
└── README.md

Small descriptives

src/

This directory contains the source code of the project.

src/assets/

This directory contains the assets of the project.

easy-git.sh

The main file of the project. It contains the commands of the project.

add-commands.sh

A file to add the commands to your shell configuration file (e.g. ~/.zshrc).

Supported platforms

(Tested on MacOS)

  • zsh
  • bash

Future improvements

  • Compatibility with other shells
  • Add more commands to manage workspaces
  • Use of gitflow

Contributing

If you want to contribute to the project, you can follow the steps described in the CONTRIBUTING file.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

easy-git's People

Contributors

morgankryze avatar

Watchers

 avatar

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.