-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
设置 git 别名 #6435
设置 git 别名 #6435
Conversation
校对认领 |
@weisiwu 好的呢 🍺 |
校对认领 |
@imononoke 妥妥哒 🍻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
完成校对。@EmilyQiRabbit @lsvih
TODO1/git-aliases.md
Outdated
> * 校对者: | ||
|
||
# Git Aliases I Use (Because I'm Lazy) | ||
# 我常用的 Git 别名(我大概是疯了) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(因为我实在太懒了)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈哈,一直看成 crazy,还想了半天这里怎么翻译好呢?为啥作者要说自己 crazy 呢??🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈哈😄我也觉得你应该是看错了
TODO1/git-aliases.md
Outdated
|
||
## I really dislike typing out git commands, even the short ones. | ||
## 我真的很烦输入 git 命令,就算它们很短也一样。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
即使是很短的
TODO1/git-aliases.md
Outdated
|
||
```shell-session | ||
$ git commit --amend --no-edit | ||
``` | ||
|
||
This amends your staged changes into your most recent commit without changing its commit message (so Git won’t open a text editor!). My most common use case for it was fixing changes I’d **just** committed. Maybe I was just careless, but I’d often finish a commit only to find a typo or debug line not 30 seconds later 😠. | ||
这条命令会把你暂存的修改并入你最近的一次 commit,并且不会修改这次 commit 的信息(这样 Git 也就不会打开一个文件编辑界面了)。它最经常的用途是修改**刚刚**提交的 commit。也许是用来修改 30 秒前刚刚提交,但是不小心写错的内容,比如拼写错误或者忘记删除的调试信息😠。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也许我太粗心了,总是在刚提交完一条 commit 还不到 30 秒,就发现一个拼写错误或者忘了删除了调式信息了 😠。
TODO1/git-aliases.md
Outdated
|
||
If you google something like ”**shorten git commands**,” you’ll quickly find out about [Git Aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases). Turns out, shortening commands is built into Git! All you have to do is tell Git what you want to alias. For example, you can shorten `status` to `s` by copy and pasting this line into your terminal: | ||
如果你在 google 搜索**简写 git 命令**这样的内容,你将会很快的找到关于 [Git 别名](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases)的信息。事实是,简写命令的方法已经内建在 Git 中了!你只需要告知 Git 你想要配置的 git 别名的信息即可。例如,你可以通过将如下这行代码复制粘贴到你的控制台并执行,就可以将 `status` 简写为 `s`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当你用 google 搜索下如“简化 git 命令”这样的内容
TODO1/git-aliases.md
Outdated
|
||
##### git aliases | ||
##### git aliase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git aliases
@weisiwu 记得校对一下 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这篇文章感觉很无聊,没有什么知识点。不过翻译者还是非常尽心的。
TODO1/git-aliases.md
Outdated
|
||
The one that always got me was: | ||
比如说如下这样很恼人的长命令: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该是说我常遇到的一个命令,没有 get me annoy.
TODO1/git-aliases.md
Outdated
|
||
```shell-session | ||
$ git commit --amend --no-edit | ||
``` | ||
|
||
This amends your staged changes into your most recent commit without changing its commit message (so Git won’t open a text editor!). My most common use case for it was fixing changes I’d **just** committed. Maybe I was just careless, but I’d often finish a commit only to find a typo or debug line not 30 seconds later 😠. | ||
这条命令会把你暂存的修改并入你最近的一次 commit,并且不会修改这次 commit 的信息(这样 Git 也就不会打开一个文件编辑界面了)。它最经常的用途是修改**刚刚**提交的 commit。也许是用来修改 30 秒前刚刚提交,但是不小心写错的内容,比如拼写错误或者忘记删除的调试信息😠。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just 就是markdown 的强调,可以用双引号表示同样的意思(个人建议)。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wiki 里的翻译指南里没找到相关的内容,我觉得还是和原文保持一致吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO1/git-aliases.md
Outdated
|
||
If you google something like ”**shorten git commands**,” you’ll quickly find out about [Git Aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases). Turns out, shortening commands is built into Git! All you have to do is tell Git what you want to alias. For example, you can shorten `status` to `s` by copy and pasting this line into your terminal: | ||
如果你在 google 搜索**简写 git 命令**这样的内容,你将会很快的找到关于 [Git 别名](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases)的信息。事实是,简写命令的方法已经内建在 Git 中了!你只需要告知 Git 你想要配置的 git 别名的信息即可。例如,你可以通过将如下这行代码复制粘贴到你的控制台并执行,就可以将 `status` 简写为 `s`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同样,xx 是表示强调。
TODO1/git-aliases.md
Outdated
|
||
If you google something like ”**shorten git commands**,” you’ll quickly find out about [Git Aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases). Turns out, shortening commands is built into Git! All you have to do is tell Git what you want to alias. For example, you can shorten `status` to `s` by copy and pasting this line into your terminal: | ||
如果你在 google 搜索**简写 git 命令**这样的内容,你将会很快的找到关于 [Git 别名](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases)的信息。事实是,简写命令的方法已经内建在 Git 中了!你只需要告知 Git 你想要配置的 git 别名的信息即可。例如,你可以通过将如下这行代码复制粘贴到你的控制台并执行,就可以将 `status` 简写为 `s`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL 替换一下吧, git-scm 提供了中文翻译的地址
https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-Git-%E5%88%AB%E5%90%8D
TODO1/git-aliases.md
Outdated
|
||
Finally, there’s one more shorthand I like to use: | ||
最后,这儿还有一个我常用的简写: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好加一下上下文,这个 bash 命令的简写。
@weisiwu @imononoke 感谢校对~ |
@sunui 修改完成 |
@sunui @EmilyQiRabbit 校对完成。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我是不请自来的
TODO1/git-aliases.md
Outdated
|
||
Typing all 28 characters of `git commit --amend --no-edit` gets old pretty fast. I’m pretty into [optimizing things](/tag/performance/) (even when I [probably shouldn’t be](/blog/avoid-premature-optimization/) 🤷), so one day I procrastinated by thinking about ways to optimize my Git commands… | ||
输入 `git commit --amend --no-edit` 这 28 个字符很快就会让人感到乏味。我现在正着迷于[优化项目](https://victorzhou.com/tag/performance/)(甚至是一些[不成熟的尝试](https://victorzhou.com/blog/avoid-premature-optimization/)🤷),所以某天我就开始花时间思考如何优化我的 git 命令… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optimizing things, probably shouldn't be 和 premature optimization 三个词组是要结合在一起理解的
premature 指的不是事物本身不成熟,而是时机还不成熟、来得过早;手法、行为方面的不成熟是 immature
这段说的是:作者很喜欢做优化工作,有时甚至会在还不应该进行优化的时候就动手了 (附上一篇讲述“过早优化”的博文)
@portandbridge 感谢指正,已修改~ |
@EmilyQiRabbit 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。 掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件。 |
发布的时候请检查一下公式是否能正常显示哈 |
译文翻译完成,resolve #6420