git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
hhrmatata
V2EX  ›  git

如何查看本地仓库和服务器仓库谁的版本是最新版本

  •  
  •   hhrmatata · May 9, 2013 · 4252 views
    This topic created in 4793 days ago, the information mentioned may be changed or developed.
    请问如何查看本地仓库和服务器仓库谁的版本是最新版本?
    谢谢!
    8 replies    1970-01-01 08:00:00 +08:00
    swulling
        1
    swulling  
       May 9, 2013   ❤️ 1
    fetch下来看,不要用pull,pull会自动merge
    hhrmatata
        2
    hhrmatata  
    OP
       May 10, 2013
    @swulling 通过你的提示,我找到了完整的命令。

    git fetch origin master:tmp
    git diff tmp
    git merge tmp
    git branch -d tmp

    从远程获取最新的版本到本地的tmp分支上
    之后再进行比较合并
    来源:http://hubingforever.blog.163.com/blog/static/171040579201233092913756/
    hhrmatata
        3
    hhrmatata  
    OP
       Jun 1, 2013
    没有命令能够比较本地仓库和服务器仓库的最后提交时间吗?时间在后的应该就是更新的版本
    bitsmix
        4
    bitsmix  
       Jun 1, 2013 via iPhone   ❤️ 1
    git log origin/master
    henryzhou
        5
    henryzhou  
       Jun 1, 2013
    git ls-remote
    hhrmatata
        6
    hhrmatata  
    OP
       Jun 19, 2013
    @henryzhou git ls-remote看不到时间,仍然无法知道那个版本最新。

    @bitsmix git log origin/master 这个好,和本地仓库git log比较修改时间即可。
    bitsmix
        7
    bitsmix  
       Jun 19, 2013
    @hhrmatata 其实看时间是不对的。时间比较早的 commit 也是可以跑到 commit tree 最顶端的哟
    hhrmatata
        8
    hhrmatata  
    OP
       Jun 19, 2013
    @bitsmix 这算bug吗?

    大家就没有比较的需求吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5682 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 06:23 · PVG 14:23 · LAX 23:23 · JFK 02:23
    ♥ Do have faith in what you're doing.