V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wuxc
V2EX  ›  程序员

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

  •  2
     
  •   wuxc ·
    wuxc · 2016-09-15 11:55:49 +08:00 · 2800 次点击
    这是一个创建于 2976 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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

    欢迎试用和建议~

    第 1 条附言  ·  2016-09-25 14:15:02 +08:00
    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 条回复    2016-09-16 03:57:24 +08:00
    maxmilia
        1
    maxmilia  
       2016-09-15 12:01:21 +08:00
    报告:

    You are currently on branch: branch_name
    Continue? (Y/N)
    y
    No more commits.
    wuxc
        2
    wuxc  
    OP
       2016-09-15 12:20:08 +08:00
    @maxmilia 可以看下你当前在什么 branch 上么?
    jeremaihloo
        3
    jeremaihloo  
       2016-09-16 03:57:24 +08:00 via Android
    最近正好需要已 star
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3037 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 10:52 · PVG 18:52 · LAX 02:52 · JFK 05:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.