Skip to content

Commit 94dd6e3

Browse files
committed
Merge pull request #182 from networm/09-git-and-other-scms_import-p4
Translate 09-git-and-other-scms import-p4
2 parents d3e6023 + a459270 commit 94dd6e3

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

book/09-git-and-other-scms/sections/import-p4.asc

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
==== Perforce
33

44
(((Perforce)))(((Importing, from Perforce)))
5-
The next system you'll look at importing from is Perforce.
6-
As we discussed above, there are two ways to let Git and Perforce talk to each other: git-p4 and Perforce Git Fusion.
5+
下一个将要看到导入的系统是 Perforce
6+
就像我们之前讨论过的,有两种方式让 Git Perforce 互相通信:git-p4 Perforce Git Fusion
77

88
===== Perforce Git Fusion
99

10-
Git Fusion makes this process fairly painless.
11-
Just configure your project settings, user mappings, and branches using a configuration file (as discussed in <<_p4_git_fusion>>), and clone the repository.
12-
Git Fusion leaves you with what looks like a native Git repository, which is then ready to push to a native Git host if you desire.
13-
You could even use Perforce as your Git host if you like.
10+
Git Fusion 使这个过程毫无痛苦。
11+
只需要使用在 <<_p4_git_fusion>> 中讨论过的配置文件来配置你的项目设置、用户映射与分支,然后克隆整个仓库。
12+
Git Fusion 让你处在一个看起来像是原生 Git 仓库的环境中,如果愿意的话你可以随时将它推送到一个原生 Git 托管中。
13+
如果你喜欢的话甚至可以使用 Perforce 作为你的 Git 托管。
1414

1515
[[_git_p4]]
1616
===== Git-p4
1717

18-
Git-p4 can also act as an import tool.
19-
As an example, we'll import the Jam project from the Perforce Public Depot.
20-
To set up your client, you must export the P4PORT environment variable to point to the Perforce depot:
18+
Git-p4 也可以作为一个导入工具。
19+
作为例子,我们将从 Perforce 公开仓库中导入 Jam 项目。
20+
为了设置客户端,必须导出 P4PORT 环境变量指向 Perforce 仓库:
2121

2222
[source,console]
2323
----
@@ -26,12 +26,12 @@ $ export P4PORT=public.perforce.com:1666
2626

2727
[NOTE]
2828
====
29-
In order to follow along, you'll need a Perforce depot to connect with.
30-
We'll be using the public depot at public.perforce.com for our examples, but you can use any depot you have access to.
29+
为了继续后续步骤,需要连接到 Perforce 仓库。
30+
在我们的例子中将会使用在 public.perforce.com 的公开仓库,但是你可以使用任何你有权限的仓库。
3131
====
3232

3333
(((git commands, p4)))
34-
Run the `git p4 clone` command to import the Jam project from the Perforce server, supplying the depot and project path and the path into which you want to import the project:
34+
运行 `git p4 clone` 命令从 Perforce 服务器导入 Jam 项目,提供仓库、项目路径与你想要存放导入项目的路径:
3535

3636
[source,console]
3737
----
@@ -42,11 +42,11 @@ Import destination: refs/remotes/p4/master
4242
Importing revision 9957 (100%)
4343
----
4444

45-
This particular project has only one branch, but if you have branches that are configured with branch views (or just a set of directories), you can use the `--detect-branches` flag to `git p4 clone` to import all the project's branches as well.
46-
See <<_git_p4_branches>> for a bit more detail on this.
45+
这个特定的项目只有一个分支,但是如果你在分支视图(或者说一些目录)中配置了一些分支,你可以将 `--detect-branches` 选项传递给 `git p4 clone` 来导入项目的所有分支。
46+
查看 <<_git_p4_branches>> 来了解关于这点的更多信息。
4747

48-
At this point you're almost done.
49-
If you go to the `p4import` directory and run `git log`, you can see your imported work:
48+
此时你几乎已经完成了。
49+
如果进入 `p4import` 目录中并运行 `git log`,可以看到你的导入工作:
5050

5151
[source,console]
5252
----
@@ -68,11 +68,11 @@ Date: Tue Jul 7 01:35:51 2009 -0800
6868
[git-p4: depot-paths = "//public/jam/src/": change = 7304]
6969
----
7070

71-
You can see that `git-p4` has left an identifier in each commit message.
72-
It's fine to keep that identifier there, in case you need to reference the Perforce change number later.
73-
However, if you'd like to remove the identifier, now is the time to do so – before you start doing work on the new repository.
71+
你可以看到 `git-p4`在每一个提交里都留下了一个标识符。
72+
如果之后想要引用 Perforce 的修改序号的话,标识符保留在那里也是可以的。
73+
然而,如果想要移除标识符,现在正是这么做的时候 - 在你开始在新仓库中工作之前。
7474
(((git commands, filter-branch)))
75-
You can use `git filter-branch` to remove the identifier strings en masse:
75+
可以使用 `git filter-branch` 将全部标识符移除。
7676

7777
[source,console]
7878
----
@@ -81,7 +81,7 @@ Rewrite e5da1c909e5db3036475419f6379f2c73710c4e6 (125/125)
8181
Ref 'refs/heads/master' was rewritten
8282
----
8383

84-
If you run `git log`, you can see that all the SHA-1 checksums for the commits have changed, but the `git-p4` strings are no longer in the commit messages:
84+
如果运行 `git log`,你会看到所有提交的 SHA-1 校验和都改变了,但是提交信息中不再有 `git-p4` 字符串了:
8585

8686
[source,console]
8787
----
@@ -99,4 +99,4 @@ Date: Tue Jul 7 01:35:51 2009 -0800
9999
Fix spelling error on Jam doc page (cummulative -> cumulative).
100100
----
101101

102-
Your import is ready to push up to your new Git server.
102+
现在导入已经准备好推送到你的新 Git 服务器上了。

0 commit comments

Comments
 (0)