Package: pigit
PIGITA terminal tool for git. Read as [Pi Git], meaning to use git like pig it. When we use git, do you feel very uncomfortable with too long commands. For example:git status --short, this project can help you improve it. This project is written in Python. Now most UNIX like systems come with Python. So you can easily install and use it.UsageIf you want to use it, you must first know what it can do.The command ofpigit -horpigit --helpto get the help message with usage. Like this:usage:pigit[-h][-v][-r][-f][-i][-c[PATH]][-C][--create-ignoreTYPE][--create-config]{cmd,repo}...

PigitTUIiscalledautomaticallyifnoparametersarefollowed.

positionalarguments:{cmd,repo}cmdgitshortcommand.reporepooptions.openopenremoterepositoryinwebbrowser.

optionalarguments:-h,--helpshowthishelpmessageandexit-v,--versionShowversionandexit.-r,--reportReportthepigitdescandexit.-f,--configDisplaytheconfigofcurrentgitrepositoryandexit.-i,--informationShowsomeinformationaboutthecurrentgitrepository.

toolsarguments:Auxiliarytypecommands.-c[PATH],--count[PATH]Countthenumberofcodesandoutputthemintabularform.Agivenpathcanbeaccepted,andthedefaultisthecurrentdirectory.-C,--completeAddshellpromptscriptandexit.(Supportedbash,zsh,fish)--create-ignoreTYPECreateademo.gitignorefile.Needoneargument,support:[android,c++,cpp,c,dart,elisp,gitbook,go,java,kotlin,lua,maven,node,python,qt,r,ros,ruby,rust,sass,swift,unity]--create-configCreateapre-configuredfileofPIGIT.(Ifaprofileexists,thevaluesavailableinitareused)cmdThe command ofcmdsupport some short sub-command to replace the long git original command.Usepigit cmd -sto check what short command it supported, it will display the corresponding help information and the git original command, like this:These are short commands that can replace git operations:
    b        lists, creates, renames, and deletes branches.
             git branch
    bc       creates a new branch.
             git checkout -b
    bl       lists branches and their commits.
             git branch -vv
    bL       lists local and remote branches and their commits.
             git branch --all -vv
    bs       lists branches and their commits with ancestry graphs.
             git show-branch
    bS       lists local and remote branches and their commits with ancestry graphs.
             git show-branch --all
    bm       renames a branch.
             git branch --move
    bM       renames a branch even if the new branch name already exists.
             git branch --move --force
    bd       delete a local branch by name.
             git branch -d
......repoThe command ofreposupport operate multiple repos at the same time.Usepigit repo -hto get more help.InteractionEven if you can use short commands instead of long commands of git, there are still some cases where simple commands can be very bad. For example:git add a/b/1.txt b/c/1.txt c/d/1.txt.Therefore, we need a TUI to help us, so Pigit provides a simple command-line interactive TUI. When you usepigitwithout following any parameters, you will enter it.And in the interaction mode, you can use?orhto see the help message.InstallationPippipinstall-UpigitSourcegitclonehttps://github.com/zlj-zz/pigit.git--depth=1cdpigit
makeinstall# orpythonsetup.pyinstall# On windowsAliasAlias is good way to help you usepigitfaster . Open your shell profile and append:iftypepigit>/dev/null2>&1;thenaliaspg="pigit"aliasg="pigit cmd"aliasgr="pigit repo"fiThen, you can usepgto callpigitand usegto callpigit cmd.ConfigurationYou can usepigit --create-configto create a template configuration atpigithome path.On Linux or MacOS:~/.config/pigitOn windows should be:C:\\User\\<your username>hereis a configuration template.config keytypedefaultdesccmd_show_originalboolTrueShow original git command.cmd_recommendboolTrueIs it recommended to correct when entering wrong commands.tui_help_showtimefloat1.5Display time of help information in interactive mode.counter_use_gitignoreboolTrueWhether to use the ignore configuration of the.gitignorefile.counter_show_invalidboolFalseWhether show files that cannot be counted.counter_show_iconboolTrueWhether show files icons. Font support required, like: 'Nerd Font'.counter_formatstrtableOutput format of statistical results. Supported: [table, simple]git_config_formatstrtableGit local config print format. Supported: [table, normal]repo_info_includelist["remote", "branch", "log"]Control which parts need to be displayed when viewing git repository information. Support: (path,remote,branch,log,summary)repo_auto_appendboolFalseWhether auto append path to repos.debug_openboolFalseWhether run PIGIT in debug mode.log_outputboolFalseWhether output log in terminal.Extra cmdsYou can setting your custom cmds. It need create aextra_cmds.pyfile at thepigithome. And writing like this:importosdefprint_user(args):print(os.system('whoami'))extra_cmds={'echo':{'command':'echo 123',},'print-user':{'command':print_user,'type':'func','help':'print system user name.'}}Theextra_cmdsdict is must. And the structure is command key and command info.The command info has some options:command: (Must have) Short life corresponds to the complete command or a method. If it is a method, it must receive a parameter tuple.type: (Option) Mark the type of command, support ['func', 'command'], and the default is 'command'.help: (Option) Command help message.has_arguments: (Option, bool) Whether the command accepts parameters. Default is True.FeatureShort command for quick use Git, and custom your short command.Provides command correction, when the command is wrong.Have a simple tui interaction, complete very troublesome operations.Code statistics and can be beautifully displayed.Support generate and use shell completion script.Support create.gitignoretemplate from internet.Support quick open remote url on website.Support manage multi repos.Have log output and help message tips.LICENSE:MIT