git-x-一组方便的git扩展。

git-x的Python项目详细描述


LicenseGitHub license
CItravis
PackagesPyPIPyPI - FormatPyPI - Python Version

git-x-一组方便的git扩展。

安装

pip install git-x --upgrade

如何使用

显示帮助消息

运行

git-x

,或者忽略git-x中的-

git x

它将输出帮助消息,显示所有可用的命令:

$ git x
Usage: git-x [OPTIONS] COMMAND [ARGS]...

Options:
  -h  Show this message and exit.

Commands:
  a      Add file contents to the index
  amend  Amend files into repository
  b      Show current branch name
  ci     Commit all the indexed files
  cia    Add files into index and commit
  co     Checkout/Create branch
  llg    Show recent <number> logs
  m      Merge codes from branch <from> to current branch
  p      Pull latest code
  pr     Create pull request from current branch to <to_branch>
  st     Show the working tree status
  up     Create remote branch

注意:如果在windows中有类似于git-x.exe的exe,或者在linux或mac中有类似于git-x.sh的exe,则可以直接使用git x运行该命令。这是由git处理的。

运行命令

git-x包含命令列表,让我们以st为例:

有几种方法可以运行命令:

1.使用git-x
运行

运行

git x st -h

或者,

git-x st -h

它将输出st命令的帮助文档:

$ git x st -h
Usage: git-x st [OPTIONS]

  Show file status, same as 'git status'

Options:
  -h  Show this message and exit.
2。使用git-git
运行

您可能会在用法行中看到,它显示git-st,这意味着您可以使用git-

git-st -h

或者,甚至可以使用git

git st -h

它们都输出st命令的帮助文档:

$ git-st -h
Usage: git-st [OPTIONS]

  Show file status, same as 'git status'

Options:
  -h  Show this message and exit.

所有命令的用法

接下来,我们将展示每个命令的详细用法:

吉特x

列出所有可用的命令:

Usage: git-x [OPTIONS] COMMAND [ARGS]...

Options:
  -h  Show this message and exit.

Commands:
  a      Add file contents to the index
  amend  Amend files into repository
  b      Show current branch name
  ci     Commit all the indexed files
  cia    Add files into index and commit
  co     Checkout/Create branch
  llg    Show recent <number> logs
  m      Merge codes from branch <from> to current branch
  p      Pull latest code
  pr     Create pull request from current branch to <to_branch>
  st     Show the working tree status
  up     Create remote branch

吉特A

这是此命令的说明和示例:

Usage: git-a [OPTIONS] <pathspec>

  Add file that specified in <pathspec> contents into the index.
  Ignore/Remove the file contents from the index if the files are specified in the -x option.
  The <pathspec> syntax is same as the one in 'git status' parameter.

  Examples:
      1. Add all sql files:
          git a *.sql
      2. Add all files, but ignore all config files(ending with .config extensions)
          git a . -x *.config
      3. Ignore multiple files(*.config, *.md) by using more than one '-x' to specify multiple patterns.
          git a . -x *.config -x *.md
      4. Remove all config files from the index
          git -x *.config

Options:
  -x, --exclude <pathspec>  Exclude the files that match the pattern(same as
                            the <pathspec> for 'git add' command)
  -h                        Show this message and exit.

git修正

这是此命令的说明和示例:

Usage: git-amend [OPTIONS]

  Amend files into repository, this only amend the files that already in the index.

  Examples:
      1. Amend without editing
          git amend
      2. Amend, and edit the commit message, this will open the editing window,
          depends on what editor is configured in git.
          git amend -e

Options:
  -e, --edit  Prompt edit window  [default: False]
  -h          Show this message and exit.

吉特B

这是此命令的说明和示例:

Usage: git-b [OPTIONS]

  Show current branch name.

  Example:
      git b

Options:
  -h  Show this message and exit.

git ci

这是此命令的说明和示例:

Usage: git-ci [OPTIONS] <comment>

  Commit all the indexed files into repository, same as 'git commit -m <comment>'.

  Example:
      git ci "This is the comment."

Options:
  -h  Show this message and exit.

吉特中央情报局

这是此命令的说明和示例:

Usage: git-cia [OPTIONS] <comment>

  Add content files into index, and then create a new commit.
  By default it will add all the files under the current folder.
  You can ignore/remove files by specifying in the '-x' option.
  This is a combination of the following commands:
  `git a . -x <pathspec>`
  `git commit -m <comment>`

  Examples:
      1. Add all files and create a commit.
          git cia "This is the comment"
      2. Exclude *.config files, and create a commit.
          git -x *.config "This is the comment"
      3. Exclude the *.cs and *.config files, and create a commit.
          git -x *.config -x *.cs "This is the comment"

Options:
  -x, --exclude <pathspec>
  -h                        Show this message and exit.

吉特公司

这是此命令的说明和示例:

Usage: git-co [OPTIONS] <branch> <start_point>

  Check out the branch matching the string in <branch>.
  If multiple branches include the <branch> text, all those branches will be listed and let user to choose.
  This only works if '-b' is not present.
  If '-b' is present, a new branch with name <branch> will be created.

  Examples:
      Suppose we have 4 existing branches - master, develop, feature_1, feature_2
      1. Switch to an existing branch 'develop'
          git co develop
      2. Create a new branch 'feature_3'
          git co -b feature_3
      3. Create a new branch, and set the start point with <start_point>
          git co -b feature_3 32aa51b
      4. Switch to a branch with name like 'feature_*'
          gi co feature_

          Then it will list all indexed branches with 'feature_' in the name, and let the user to choose:

          Found 4 branches including "feature_":
          ====================
          0: feature_1
          1: feature_2
          ====================
          Please select branch by index:

          Then, the user can choose 0, click ENTER to switch to feature_1 branch.

Options:
  -b  Indicate to create the branch if it doesn't exist, same to '-B' option
      in 'git checkout' command.  [default: False]
  -h  Show this message and exit.

吉特有限责任公司

这是此命令的说明和示例:

Usage: git-llg [OPTIONS] <number>

  Show recent <number> logs, the default number is 5.
  This is same as 'git log --oneline -n <number>'

  Example:
      1. Show recent 5 commit messages.
          git llg
      2. Show recent 6 commit messages.
          git llg 6
      3. Show with graph
          git llg -g
      4. Show with graph, author, and date
          git llg -gad

Options:
  -g, --graph   Show in graph mode
  -a, --author  Show the author name of each commit
  -d, --date    show relative date of each commit
  -h            Show this message and exit.

吉特m

这是此命令的说明和示例:

Usage: git-m [OPTIONS] <from>

  Merge codes from branch <from> to current branch.
  It will switch to branch <from>, pull the latest code, and then switch back to previous branch,
  and merge the code from <from> into current branch. You need to make sure that there is no unstaged changes.

  Examples:
      1. Merge latest code from master branch to current branch(develop)
          git m master

Options:
  -h  Show this message and exit.

吉特p

这是此命令的说明和示例:

Usage: git-p [OPTIONS]

  Pull the latest code from remote  with '--rebase' option.
  It is same as 'git pull --rebase'

Options:
  -h  Show this message and exit.

吉特公关

这是此命令的说明和示例:

Usage: git-pr [OPTIONS] <to_branch>

  Create pull request from current branch to <to_branch>.
  Currently it only support to raise pull request to github and bitbucket.
  The repository url is retrieved from the .git/config file.

  Examples:
      1. Create PR against master branch
          git pr master

Options:
  -h  Show this message and exit.

吉特街

这是此命令的说明和示例:

Usage: git-st [OPTIONS]

  Show the working tree status, same as 'git status'

Options:
  -h  Show this message and exit.

加速

这是此命令的说明和示例:

Usage: git-up [OPTIONS]

  Create remote branch,
  same as 'git push --set-upstream origin'

Options:
  -h  Show this message and exit.

注意

You need to install git cli tool first, as all the commands will call the native git commands eventually.

最后,用git-x快乐地git

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java游戏!框架伪造应用程序它实际上做什么?   java如何在JavaFx中显示表视图中的即时更改?   对象类的equals()方法的java重载   xpages介绍如何部署java。IBM Notes中的策略更改   java如何访问侦听器中的另一个视图?   java getDefaultDisplay()的替代方法是什么   java opencv匹配模板   java Android Firebase写入数据时的常量超时   在Java中,如何将包含大量空格的数字字符串转换为一系列Int变量。   带有GUI的swing Java模拟无法运行模拟   java NoSuchElementException在特定的Web端上使用无头铬和硒   java对文件进行迭代,即使文件在目录中也会出现“未找到文件”异常。你能告诉我为什么吗?谢谢   递归Java 8,匿名递归嵌套方法   java为什么我看到枚举常量的字段值会被序列化/反序列化?在哪种情况下,枚举中哪些内容没有序列化?   java在运行sonar scanner和Spotbugs规则时出错,用于单片项目?   java如何检查硬件键盘是否可用?(黑莓)   tile游戏动作侦听器循环中的java错误   sockets Java线程池与高请求场景中的新线程   java如何使用Hibernate注释在联接表上创建索引?