-
Notifications
You must be signed in to change notification settings - Fork 362
Translate 10-git-internals maintenance v2 #185
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
Conversation
|
||
Occasionally, you may have to do some cleanup – make a repository more compact, clean up an imported repository, or recover lost work. | ||
This section will cover some of these scenarios. | ||
偶尔,你必须要做一些清理 - 使一个仓库体积更小、清理一个导入的仓库、或者恢复丢失的工作。 |
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.
有的时候,你需要对版本库进行清理 - 使它的结构变得更紧凑,或是对导入的版本库进行清理,或是恢复丢失的内容。
You need to get rid of anything that has a pointer to those old commits before you repack: | ||
你的历史不再包含对那个文件的引用。 | ||
然而,你的引用日志与你在 `.git/refs/original` 下做的 `filter-branch` 添加的一个新引用还引用着,所以你必须移除它们然后重新打包数据库。 | ||
在重新打包前需要移除任何包含指向那些旧提交的指针的东西: |
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.
东西——文件
@networm 审校完成 |
@sanddudu 已修正;有问题的已评论;“仓库”与“版本库”最终决定保留“仓库”,所以以上不需要更改。 |
The ``gc'' stands for garbage collect, and the command does a number of things: it gathers up all the loose objects and places them in packfiles, it consolidates packfiles into one big packfile, and it removes objects that aren't reachable from any commit and are a few months old. | ||
Git 会不定时的自动运行一个叫做 ``auto gc'' 的命令。 | ||
大多数时候,这个命令并不会产生效果。 | ||
然而,如果有太多松散对象(不在包文件中的对象)或者太多包文件,Git 运行一个完整的 `git gc` 命令。 |
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 会
运行一个完整的 git gc
命令
@networm 已完成 |
@IceNature 已修正。 |
To get the appropriate SHA for a given reference, Git checks for that reference in the `refs` directory and then checks the `packed-refs` file as a fallback. | ||
However, if you can't find a reference in the `refs` directory, it's probably in your `packed-refs` file. | ||
如果你更新了引用,Git 并不会修改这个文件,而是向 `refs/heads` 创建一个新的文件。 | ||
为了获得给一个引用的正确的 SHA,Git 会首先在 `refs` 目录中查找指定的引用,然后再到 `packed-refs` 文件中查找。 |
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.
为了获得给一个引用的正确的 SHA —— 为了获得指定引用的正确 SHA 值
@networm 补充了一点 |
@sanddudu 已修正。 |
Most of the time, this command does nothing. | ||
However, if there are too many loose objects (objects not in a packfile) or too many packfiles, Git launches a full-fledged `git gc` command. | ||
The ``gc'' stands for garbage collect, and the command does a number of things: it gathers up all the loose objects and places them in packfiles, it consolidates packfiles into one big packfile, and it removes objects that aren't reachable from any commit and are a few months old. | ||
Git 会不定时的自动运行一个叫做 ``auto gc'' 的命令。 |
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.
不定时地
,不是的
。
顺带说一下,的地得的乱用在审校中见过不少。。。
@networm 已审核完毕,并提出 6 个修改意见。 |
@Geno1024 已修正。 |
Translate 10-git-internals maintenance
@IceNature @Geno1024 @sanddudu 已合并入主干。 |
No description provided.