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

有大佬知道这个怎么改回去吗,不知道怎么操作的

  •  
  •   snake001 · 2021-03-25 19:55:35 +08:00 · 2746 次点击
    这是一个创建于 1121 天前的主题,其中的信息可能已经有所发展或是发生改变。
    19 条回复    2021-03-25 21:21:04 +08:00
    snake001
        1
    snake001  
    OP
       2021-03-25 19:57:00 +08:00
    mac 打开终端:➜ ~ git:(master) ✗
    lhyUnited
        2
    lhyUnited  
       2021-03-25 19:59:34 +08:00
    git status
    git checkout .
    snake001
        3
    snake001  
    OP
       2021-03-25 20:03:44 +08:00
    Last login: Thu Mar 25 19:53:06 on ttys000
    ➜ ~ git:(master) ✗
    ➜ ~ git:(master) ✗
    ➜ ~ git:(master) ✗
    ➜ ~ git:(master) ✗
    ➜ ~ git:(master) ✗
    ➜ ~ git:(master) ✗
    ➜ ~ git:(master) ✗

    我的 mac 打开终端现在名称变成 git:(master),这个怎么才能修改呀
    snake001
        4
    snake001  
    OP
       2021-03-25 20:04:54 +08:00
    @lhyUnited 不是 git 的目录,只是名称变了
    lcdtyph
        5
    lcdtyph  
       2021-03-25 20:06:43 +08:00 via iPhone
    你是不是在~下执行过 git init 啊…
    snake001
        6
    snake001  
    OP
       2021-03-25 20:07:42 +08:00
    @lcdtyph 不记得了
    Cuo
        7
    Cuo  
       2021-03-25 20:07:53 +08:00 via iPhone   ❤️ 2
    看看 home 下面有没有 .git 有的话就 rf -rf .git
    snake001
        8
    snake001  
    OP
       2021-03-25 20:10:37 +08:00
    @Cuo 执行完 rm -rf .git 后现在成空的了
    Last login: Thu Mar 25 20:08:49 on ttys000
    ➜ ~
    ➜ ~
    ➜ ~
    ➜ ~
    ➜ ~
    ➜ ~
    ➜ ~
    ➜ ~
    lhyUnited
        9
    lhyUnited  
       2021-03-25 20:11:44 +08:00   ❤️ 1
    @Cuo 正解,但你好像拼错了,rm -rf 吧
    lhyUnited
        10
    lhyUnited  
       2021-03-25 20:13:27 +08:00
    @snake001 这不符合你的预期吗?
    snake001
        11
    snake001  
    OP
       2021-03-25 20:13:33 +08:00
    @lhyUnited 原来有个自己电脑的名字,现在空白了,怎么加回去呢
    Cuo
        12
    Cuo  
       2021-03-25 20:15:00 +08:00 via iPhone
    @snake001 这应该是想要的效果?


    @lhyUnited 手滑手滑🤣
    snake001
        13
    snake001  
    OP
       2021-03-25 20:19:09 +08:00
    @Cu 想要修改成自己的名字
    lhyUnited
        14
    lhyUnited  
       2021-03-25 20:19:41 +08:00
    @snake001 用的是 oh-my-zsh 吗?如果是的,可以参考 https://www.jianshu.com/p/bf488bf22cba
    snake001
        15
    snake001  
    OP
       2021-03-25 20:20:08 +08:00
    @lhyUnited 是这个,我看看,研究下,多谢了
    hello2060
        16
    hello2060  
       2021-03-25 20:33:40 +08:00
    不是改你脚本的配置文件吗?

    .bashrc 如果是 bash 的话

    echo $SHELL 看自己用哪种 shell
    snake001
        17
    snake001  
    OP
       2021-03-25 20:52:24 +08:00
    @hello2060 经过上面两位大佬的解答已经完美解决了
    IgniteWhite
        18
    IgniteWhite  
       2021-03-25 21:17:18 +08:00
    这不是 oh-my-zsh 的 git 插件的正常功能吗……建议了解一下什么是 PS1,你可以用 echo $PS1 看一下当前的值
    IgniteWhite
        19
    IgniteWhite  
       2021-03-25 21:21:04 +08:00
    你要是想显示 hostname (你说的电脑名字),就换个 theme 。你这用的显然是默认的 robbyrussell 主题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2587 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 04:55 · PVG 12:55 · LAX 21:55 · JFK 00:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.