Skip to content

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

Merged
merged 6 commits into from
Aug 14, 2015

Conversation

networm
Copy link
Member

@networm networm commented Jul 6, 2015

No description provided.

@networm networm mentioned this pull request Jul 29, 2015
95 tasks
@networm networm modified the milestone: v1.0.0 Jul 29, 2015

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.
偶尔,你必须要做一些清理 - 使一个仓库体积更小、清理一个导入的仓库、或者恢复丢失的工作。
Copy link
Contributor

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` 添加的一个新引用还引用着,所以你必须移除它们然后重新打包数据库。
在重新打包前需要移除任何包含指向那些旧提交的指针的东西:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

东西——文件

@sanddudu
Copy link
Contributor

@networm 审校完成

@networm
Copy link
Member Author

networm commented Aug 3, 2015

@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` 命令。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git 运行一个完整的 git gc 命令

@IceNature
Copy link
Contributor

@networm 已完成

@networm
Copy link
Member Author

networm commented Aug 10, 2015

@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` 文件中查找。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为了获得给一个引用的正确的 SHA —— 为了获得指定引用的正确 SHA 值

@sanddudu
Copy link
Contributor

@networm 补充了一点

@networm
Copy link
Member Author

networm commented Aug 13, 2015

@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'' 的命令。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不定时,不是
顺带说一下,的地得的乱用在审校中见过不少。。。

@Geno1024
Copy link
Contributor

@networm 已审核完毕,并提出 6 个修改意见。

@networm
Copy link
Member Author

networm commented Aug 14, 2015

@Geno1024 已修正。

networm added a commit that referenced this pull request Aug 14, 2015
@networm networm merged commit 46befe4 into progit:master Aug 14, 2015
@networm
Copy link
Member Author

networm commented Aug 14, 2015

@IceNature @Geno1024 @sanddudu 已合并入主干。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants