V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wxsm
V2EX  ›  职场话题

十几年工作经验的老码农,连 git 都不会用。

  •  
  •   wxsm · 2020-09-30 11:55:23 +08:00 · 14140 次点击
    这是一个创建于 1276 天前的主题,其中的信息可能已经有所发展或是发生改变。
    1. 别人的 MergeRequest,都是干干净净,改了文件就是多少个 Change 。他的倒好,每次一上来就几十个 commit,几百个 change,认真一看,也就最上面那几个是他的。
    2. 经常在工位上大喊「我的代码呢」,结果到头来查历史记录往往是被自己根本就没提交,或者被自己干掉了。
    3. 同时也经常干掉别人的代码,自己完全不自知。出了问题,十有八九都是他干的。
    4. 遇到问题就知道喊,有一次自己代码拉不下来了,说别人把 remote 搞坏了,所以自己拉不了了。喊人过去一看,工具上明明白白写着:you are in a middle of rebase,做个 abord 就好了。

    以上只是冰山一角,他写的代码我就懒得说了。我也不是针对谁,就事论事,和这种人共事,就是难受。祝大家都能找到更好的工作,避免遇到这种同事。

    118 条回复    2020-10-05 11:16:04 +08:00
    1  2  
    sagaxu
        101
    sagaxu  
       2020-09-30 21:16:43 +08:00 via Android   ❤️ 1
    完全可以通过流程规避,repo 设置成禁止 force push,禁止非 fast forward push 。

    然后每次有异常的时候,都能轻易查到是谁的锅,截图发大群里
    IMXT
        102
    IMXT  
       2020-09-30 22:18:03 +08:00 via Android
    十几年外包经验?
    Gilfoylek
        103
    Gilfoylek  
       2020-09-30 22:56:45 +08:00
    @sagaxu 问下 为什么要禁止非 fast forward push,那不就成了 svn 了吗?
    sagaxu
        104
    sagaxu  
       2020-09-30 23:09:05 +08:00 via Android
    @Gilfoylek 把太多分支历史信息 merge 到 master 中,commit 历史会很杂乱
    AmrtaShiva
        105
    AmrtaShiva  
       2020-09-30 23:22:07 +08:00 via Android
    @wxsm #14 这是关系户吧
    20015jjw
        106
    20015jjw  
       2020-09-30 23:22:39 +08:00 via Android
    u1s1 用过 hg 之后 真香 git 太难用了
    laike9m
        107
    laike9m  
       2020-10-01 00:19:37 +08:00 via Android
    吐槽同事就说明该换公司了

    这句话我已经讲太多遍了。。
    Felldeadbird
        108
    Felldeadbird  
       2020-10-01 00:33:56 +08:00
    他这种根本不是不会呀。。是根本没学。
    git 本身没严格的流程控制,不熟悉的话,非常容易造成代码丢失。哈哈哈
    kiwier
        109
    kiwier  
       2020-10-01 06:38:02 +08:00 via iPhone
    @aLazarus 哈哈,他也是个人才
    tairan2006
        110
    tairan2006  
       2020-10-01 07:04:28 +08:00 via Android
    2020 年还有人不会用 git,还振振有词说是 git 的问题,真是醉了。v2 综合水平越来越低了…
    macrosea
        111
    macrosea  
       2020-10-01 10:25:42 +08:00 via iPhone   ❤️ 1
    底层人踩人,上层人捧人;该醒醒了
    weitch
        112
    weitch  
       2020-10-01 10:51:06 +08:00
    码农何必为难码农,公司又不是你开的
    falcon05
        113
    falcon05  
       2020-10-01 10:59:25 +08:00
    多人合作的时候慎用 rebase,因为会重写 commit,导致其他同事需要 re-merge 你的工作,然后你 pull 回来,事情会变得混乱。

    https://git-scm.com/book/en/v2/Git-Branching-Rebasing

    > The Perils of Rebasing

    Ahh, but the bliss of rebasing isn’t without its drawbacks, which can be summed up in a single line:

    Do not rebase commits that exist outside your repository and that people may have based work on.

    If you follow that guideline, you’ll be fine. If you don’t, people will hate you, and you’ll be scorned by friends and family.

    When you rebase stuff, you’re abandoning existing commits and creating new ones that are similar but different. If you push commits somewhere and others pull them down and base work on them, and then you rewrite those commits with git rebase and push them up again, your collaborators will have to re-merge their work and things will get messy when you try to pull their work back into yours.
    falcon05
        114
    falcon05  
       2020-10-01 11:03:25 +08:00
    不要在已发布或者公共的 commit 里 rebase
    babyblue
        115
    babyblue  
       2020-10-01 11:20:28 +08:00 via Android
    然而他脾气还特别大
    ,觉得自己根本没错 😌
    yingqi7
        116
    yingqi7  
       2020-10-01 13:13:16 +08:00 via iPhone
    @nnws2681521 你自己的当然没问题,但是我寻思着团队协作你还能不提交?
    wangzitiansky
        117
    wangzitiansky  
       2020-10-03 08:27:12 +08:00 via Android
    @liulilte 不会还不学就问题很大吧
    MannyWang
        118
    MannyWang  
       2020-10-05 11:16:04 +08:00
    Git 還用專門學?用到看一下不就可以了?
    1  2  
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5187 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 09:27 · PVG 17:27 · LAX 02:27 · JFK 05:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.