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

2021-03-25 19:55:35 +08:00
 snake001
2764 次点击
所在节点    macOS
19 条回复
snake001
2021-03-25 19:57:00 +08:00
mac 打开终端:➜ ~ git:(master) ✗
lhyUnited
2021-03-25 19:59:34 +08:00
git status
git checkout .
snake001
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
2021-03-25 20:04:54 +08:00
@lhyUnited 不是 git 的目录,只是名称变了
lcdtyph
2021-03-25 20:06:43 +08:00
你是不是在~下执行过 git init 啊…
snake001
2021-03-25 20:07:42 +08:00
@lcdtyph 不记得了
Cuo
2021-03-25 20:07:53 +08:00
看看 home 下面有没有 .git 有的话就 rf -rf .git
snake001
2021-03-25 20:10:37 +08:00
@Cuo 执行完 rm -rf .git 后现在成空的了
Last login: Thu Mar 25 20:08:49 on ttys000
➜ ~
➜ ~
➜ ~
➜ ~
➜ ~
➜ ~
➜ ~
➜ ~
lhyUnited
2021-03-25 20:11:44 +08:00
@Cuo 正解,但你好像拼错了,rm -rf 吧
lhyUnited
2021-03-25 20:13:27 +08:00
@snake001 这不符合你的预期吗?
snake001
2021-03-25 20:13:33 +08:00
@lhyUnited 原来有个自己电脑的名字,现在空白了,怎么加回去呢
Cuo
2021-03-25 20:15:00 +08:00
@snake001 这应该是想要的效果?


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

.bashrc 如果是 bash 的话

echo $SHELL 看自己用哪种 shell
snake001
2021-03-25 20:52:24 +08:00
@hello2060 经过上面两位大佬的解答已经完美解决了
IgniteWhite
2021-03-25 21:17:18 +08:00
这不是 oh-my-zsh 的 git 插件的正常功能吗……建议了解一下什么是 PS1,你可以用 echo $PS1 看一下当前的值
IgniteWhite
2021-03-25 21:21:04 +08:00
你要是想显示 hostname (你说的电脑名字),就换个 theme 。你这用的显然是默认的 robbyrussell 主题。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/765162

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX