V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
wuxc
V2EX  ›  程序员

造了个小轮子:一步步跟踪 git 的 commit 历史来学习源码

  •  2
     
  •   wuxc ·
    wuxc · Sep 15, 2016 · 3437 views
    This topic created in 3512 days ago, the information mentioned may be changed or developed.

    GitJump

    A tiny git command wrapper for view git commits.

    commands:

    • git next (git n for short): jump to next commit
    • git prev (git p for short): jump to previous commit
    • git first : jump to oldest commit
    • git last : jump to most recent commit

    Usage:

    1. load
    $ wget --no-check-certificate https://raw.githubusercontent.com/wuxc/gitjump/master/gitjump.sh
    $ source ./gitjump.sh
    

    or add it to your ~/.bashrc:

    $ echo "source `pwd`/gitjump.sh" >> ~/.bashrc
    
    1. fire
    $ cd my/awesome/repos.git
    $ git first
    $ git next
    

    Have fun!

    Other

    repo: https://github.com/wuxc/gitjump

    欢迎试用和建议~

    Supplement 1  ·  Sep 25, 2016
    update on 2016-09-25
    自己用了一段时间后,做了点修改,增加一个跳转到指定提交到命令:

    git jump 100: jump to 100th commit (git j for short)
    git jump +10: jump 10 commits newer
    git jump -10: jump 10 commits older
    git jump 03308b1a: jump to commitid starts with 03308b1a
    3 replies    2016-09-16 03:57:24 +08:00
    maxmilia
        1
    maxmilia  
       Sep 15, 2016
    报告:

    You are currently on branch: branch_name
    Continue? (Y/N)
    y
    No more commits.
    wuxc
        2
    wuxc  
    OP
       Sep 15, 2016
    @maxmilia 可以看下你当前在什么 branch 上么?
    jeremaihloo
        3
    jeremaihloo  
       Sep 16, 2016 via Android
    最近正好需要已 star
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5855 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 06:38 · PVG 14:38 · LAX 23:38 · JFK 02:38
    ♥ Do have faith in what you're doing.