交互式的 Git 操作 SHELL 環境:gitsh

jopen 10年前發布 | 41K 次閱讀 gitsh Git 版本控制系統

該gitsh程序是一個用于git的交互式shell。可以在gitsh程序中發出任何git命令,甚至可以使用你的本地別名和配置。
687474703a2f2f74686f75676874626f742e6769746875622e696f2f67697473682f696d616765732f67697473682d6c6f676f2e706e67.png

  • Git commands tend to come in groups. Avoid typing git over and over and over by running them in a dedicated git shell:

      sh$ gitsh
      gitsh% status
      gitsh% add .
      gitsh% commit -m "Ship it!"
      gitsh% push
      gitsh% :exit
      sh$
  • Hit return with no command to run git status, saving even more typing:

      gitsh% ?
      # On branch master
      nothing to commit, working directory clean
      gitsh% 
  • Make temporary modifications to your git configuration with gitsh config variables. These changes only effect git commands issues in this gitsh session and are forgotten when you exit, just like shell environment variables.

      gitsh% :set user.name 'George Brocklehurst and Mike Burns'
      gitsh% :set user.email support+george+mike@thoughtbot.com
      gitsh% commit -m 'We are pair programming'
  • Tab completion for git commands, aliases, and branches without modifying your shell settings, and without any extra setup for aliases and third party git commands.

  • Information about the state of your git repository in the prompt, without modifying your shell settings. This includes the name of the current HEAD, and a colour and sigil to indicate the status.

  • It works with hub:

    sh$ gitsh --git $(which hub)
    gitsh% pull-request

Installing gitsh

  • On Mac OS X, via homebrew:

    brew tap thoughtbot/formulae
    brew install gitsh
  • On Arch Linux: https://github.com/thoughtbot/gitsh/blob/master/arch/PKGBUILD

  • On other operating systems:

    curl -O http://thoughtbot.github.io/gitsh/gitsh-0.3.tar.gz
    tar -zxf gitsh-0.3.tar.gz
    cd gitsh-0.3
    ./configure
    make
    make install

項目主頁:http://www.baiduhome.net/lib/view/home/1392080281817

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!