• Stars
    star
    5,702
  • Rank 7,086 (Top 0.2 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 13 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Git for Humans, Inspired by GitHub for Mac™.

Legit: Git for Humans

Inspired by GitHub for Mac.

The Concept

GitHub for Mac is not just a Git client.

This comment on Hacker News says it best:

They haven't re-created the git CLI tool in a GUI, they've created something different. They've created a tool that makes Git more accessible. Little things like auto-stashing when you switch branches will confuse git veterans, but it will make Git much easier to grok for newcomers because of the assumptions it makes about your Git workflow.

Why not bring this innovation back to the command line?

The Interface

sw <branch>
Switches to specified branch. Defaults to current branch. Automatically stashes and unstashes any changes. (alias: switch for git < 2.23)
sync [<branch>]
Synchronizes the given branch. Defaults to current branch. Stash, Fetch, Auto-Merge/Rebase, Push, and Unstash. You can only sync published branches. (alias: sy)
publish [<branch>]
Publishes specified branch to the remote. (alias: pub)
unpublish <branch>
Removes specified branch from the remote. (alias: unp)
undo
Un-does the last commit in git history. (alias: un)
branches [<wildcard pattern>]
Display a list of available branches. Allows wildcard pattern matching of branch name.

The Installation

https://repl.it/badge/github/frostming/legit

From PyPI with the Python package manager:

pip install legit

Or download a standalone Windows executable from GitHub Releases.

To install the cutting edge version from the git repository:

git clone https://github.com/frostming/legit.git
cd legit
python setup.py install

Note: if you encountered Permission denied, prepend sudo before the pip or python setup.py command.

You'll then have the wonderful legit command available. Run it within a repository.

To view usage and examples, run legit with no commands or options:

legit

To install the git aliases, run the following command:

legit --install

To uninstall the git aliases, run the following command:

legit --uninstall

Command Options

All legit commands support --verbose and --fake options.

In order to view the git commands invoked by legit, use the --verbose option:

legit sync --verbose

If you want to see the git commands used by legit but don't want them invoked, use the --fake option:

legit publish --fake

Legit Options

By default, legit sync avoids a true merge. If the merge is not fast-forward, legit will rebase.

In gitconfig, if legit.smartMerge is set to false, and pull.rebase is set to false or unset, then legit will not rebase but merge.

If legit.smartMerge is set to false, and pull.ff is set to only, then if the merge is not fast-forward, legit will abort.

Caveats

  • All remote operations are carried out by the remote identified in $ git config legit.remote remotename
  • If a stash pop merge fails, Legit stops. I'd like to add checking for a failed merge, and undo the command with friendly error reporting.

More Repositories

1

marko

A markdown parser with high extensibility.
Python
342
star
2

tetos

A unified interface for multiple Text-to-Speech (TTS) providers.
Python
221
star
3

python-cfonts

Sexy fonts for the console
Python
192
star
4

Flog

A Simple Blog Powered by Flask
Vue
191
star
5

unearth

A utility to fetch and download python packages
Python
139
star
6

flask-crontab

Simple Flask scheduled tasks without extra daemons
Python
100
star
7

monas

Python monorepo made easy
Python
77
star
8

wordle-tui

Play WORDLE game in your terminal.
Python
61
star
9

pipfile-requirements

A CLI tool to covert Pipfile/Pipfile.lock to requirments.txt
Python
50
star
10

flask-vue-todo

A todo app with Vue and backed by Flask
Python
48
star
11

pdm-packer

A PDM plugin that packs your packages into a zipapp
Python
46
star
12

onepm

Picks the right package manager for you
Python
44
star
13

picguessr

Python
41
star
14

findpython

A utility to find python versions on your system
Python
36
star
15

fix-future-annotations

A CLI and pre-commit hook to fix future annotations
Python
35
star
16

oven

TypeScript
27
star
17

resume

Personal resume with a handwritten SSG
Python
24
star
18

pdm-vscode

DEPRECATED: A PDM plugin that autogenerates workspace vscode settings for you
Python
23
star
19

pycomplete

A Python library to generate static completion scripts for your CLI app
Python
22
star
20

frostming

My profile, including a chess game
Python
17
star
21

enum-adt

Python
13
star
22

renren-dumps

人人网数据备份器
Python
12
star
23

atoml

Yet another style-preserving TOML library for Python
Python
12
star
24

modul

Python modules with public exports
Python
12
star
25

lektor-tailwind

A Lektor plugin that adds Tailwind CSS to your project seamlessly
Python
11
star
26

flask-webconsole-example

A simple example of web console
HTML
10
star
27

rediswrapper

Pythonic wrapper for Redis Client.
Python
10
star
28

pbs-installer

Python
9
star
29

tokei-pie-cooker

Visualize your code statistics with Pie Chart
Python
8
star
30

scoop-frostming

My personal scoop bucket
PowerShell
7
star
31

pofmt

Your missing PO formatter and linter
Python
7
star
32

myrc

My personal profiles for Win and Mac
Shell
5
star
33

monas-example-repo

Serve as an example of how Monas manage a monorepo
Python
4
star
34

pep665_poc

A POC implementation of PEP 665
Python
4
star
35

pdm-mypyc

A build hook to compile source files with mypyc
Python
4
star
36

hexo-theme-landing-page

Hexo ported theme of Landing Page
CSS
3
star
37

package-manager-demo

Write a package manage from scratch demo repo
Python
3
star
38

transpyler-gpt

A GPT-powered Python transpiler that makes your Python code run on older versions
Python
3
star
39

frostming.github.io

My personal wiki site
Vue
2
star
40

sodoku-solver

Python
2
star
41

wordle-tg

A Telegram Bot that lets you play wordle with other people
Python
2
star
42

daily-trending

Daily trending digest based on people you follow
Python
2
star
43

flask-remote-file

Flask extension to serve remote files via sftp
Python
2
star
44

gorella

Monkey patch regular expression methods to built-in string types
Python
1
star
45

RimeConfig

My Rime Configuration
1
star
46

highlight-lexer-comparison

Lexer comparison of code highlighters
HTML
1
star
47

vscode-mingshe

VSCode language support for MingShe
1
star
48

Codingame

My solutions of https://www.codingame.com
Python
1
star
49

scoop-action

GitHub Action for Scoop buckets
JavaScript
1
star
50

tokei

PyPI package for https://github.com/XAMPPRocky/tokei
Python
1
star
51

pdm-lock-build-deps

Python
1
star
52

pycon-python-pm

PyCon 2019深圳站演讲Slide: Python包管理及Pipenv
CSS
1
star
53

backports.html

Backport of Python 3.4+'s html module
Python
1
star
54

blog_backup

个人博客MD备份
Shell
1
star