Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7fa8263
feat(customizing-git-an-example-git-enforced-policy): translate file …
YasinDehfuli Jan 25, 2025
8d0eec1
feat(customizing-git-hooks): translate file from en to fa language
YasinDehfuli Jan 25, 2025
10da4b1
feat(customizing-git-attributes): translate file from en to fa language
YasinDehfuli Jan 25, 2025
9708e05
feat(customizing-git-configuration): translate file from en to fa lan…
YasinDehfuli Jan 25, 2025
4d129ad
feat(customizing-git-summary): translate file from en to fa language
YasinDehfuli Jan 25, 2025
9ec1629
feat(git-and-other-systems-migrating-to-git): translate file from en …
YasinDehfuli Jan 25, 2025
8c0c41e
feat(git-internals-environment-variables): translate file from en to …
YasinDehfuli Jan 25, 2025
9a01def
Update ch08-customizing-git.asc
YasinDehfuli Mar 12, 2025
8dacf6b
refactor(attributes): fixed persian translate issues and fix some he…
YasinDehfuli Apr 10, 2025
ddd6ffa
refactor(config): fixed persian translate issue and headers
YasinDehfuli Apr 10, 2025
96145b6
refactor(hooks): fixed persian translate issue and headers
YasinDehfuli Apr 10, 2025
a48a57e
refactor(policy): fixed persian translate issue and headers
YasinDehfuli Apr 10, 2025
c254d10
refactor(clined-hg): fixed persian translate issue and headers
YasinDehfuli Apr 10, 2025
499d8e0
refactor(import-bzr): fixed persian translate issue and headers
YasinDehfuli Apr 11, 2025
43975f8
refactor(import-custom): fixed persian translate issue and headers
YasinDehfuli Apr 11, 2025
8fb32e1
refactor(import-hg): fixed persian translate issue and headers
YasinDehfuli Apr 11, 2025
a3c1042
refactor(import-p4): fixed persian translate issue and headers
YasinDehfuli Apr 11, 2025
60a4f54
refactor(import-svn):
YasinDehfuli Apr 11, 2025
a847d92
refactor(import-tfs): fixed persian translate issue and headers
YasinDehfuli Apr 11, 2025
31d9147
refactor(ch08-customizing-git): fixed persian translate issue and hea…
YasinDehfuli Apr 11, 2025
4db211d
refactor(ch9-git-and-other-systems): fixed persian translate issue a…
YasinDehfuli Apr 11, 2025
a991edc
refactor(environment): fixed persian translate issue and headers
YasinDehfuli Apr 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
292 changes: 162 additions & 130 deletions book/08-customizing-git/sections/attributes.asc

Large diffs are not rendered by default.

363 changes: 210 additions & 153 deletions book/08-customizing-git/sections/config.asc

Large diffs are not rendered by default.

181 changes: 98 additions & 83 deletions book/08-customizing-git/sections/hooks.asc

Large diffs are not rendered by default.

230 changes: 120 additions & 110 deletions book/08-customizing-git/sections/policy.asc

Large diffs are not rendered by default.

156 changes: 60 additions & 96 deletions book/09-git-and-other-scms/sections/client-hg.asc

Large diffs are not rendered by default.

90 changes: 46 additions & 44 deletions book/09-git-and-other-scms/sections/import-bzr.asc
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
==== Bazaar
==== Bazaar بازار
(((Bazaar)))(((Importing, from Bazaar)))

Bazaar is a DVCS tool much like Git, and as a result it's pretty straightforward to convert a Bazaar repository into a Git one.
To accomplish this, you'll need to import the `bzr-fastimport` plugin.
Bazaar یک ابزار کنترل نسخه توزیع‌شده (DVCS) شبیه به Git است، و در نتیجه تبدیل یک مخزن Bazaar به یک مخزن Git نسبتاً ساده است.
برای انجام این کار، باید افزونه `bzr-fastimport` را وارد (import) کنید.

===== Getting the bzr-fastimport plugin
===== دریافت افزونه bzr-fastimport

The procedure for installing the fastimport plugin is different on UNIX-like operating systems and on Windows.
In the first case, the simplest is to install the `bzr-fastimport` package that will install all the required dependencies.
فرآیند نصب افزونه fastimport در سیستم‌عامل‌های شبه یونیکس و ویندوز متفاوت است.
در سیستم‌عامل‌های شبه یونیکس، ساده‌ترین روش نصب پکیج bzr-fastimport است که تمامی وابستگی‌های مورد نیاز را نیز نصب خواهد کرد.

For example, with Debian and derived, you would do the following:
برای مثال، در Debian و توزیع‌های مشتق‌شده از آن، می‌توانید این کار را به شکل زیر انجام دهید:

[source,console]
----
$ sudo apt-get install bzr-fastimport
----

With RHEL, you would do the following:
با RHEL، شما باید به صورت زیر عمل کنید:

[source,console]
----
$ sudo yum install bzr-fastimport
----

With Fedora, since release 22, the new package manager is dnf:
در Fedora، از نسخه ۲۲ به بعد، مدیر بسته جدید dnf است:

[source,console]
----
$ sudo dnf install bzr-fastimport
----

If the package is not available, you may install it as a plugin:
اگر این پکیج در دسترس نباشد، می‌توانید آن را به صورت یک افزونه (plugin) نصب کنید:

[source,console]
----
$ mkdir --parents ~/.bazaar/plugins # creates the necessary folders for the plugins
$ mkdir --parents ~/.bazaar/plugins # ایجاد پوشه‌های لازم برای پلاگین‌ها
$ cd ~/.bazaar/plugins
$ bzr branch lp:bzr-fastimport fastimport # imports the fastimport plugin
$ bzr branch lp:bzr-fastimport fastimport # وارد کردن پلاگین fastimport
$ cd fastimport
$ sudo python setup.py install --record=files.txt # installs the plugin
$ sudo python setup.py install --record=files.txt # نصب پلاگین
----

For this plugin to work, you'll also need the `fastimport` Python module.
You can check whether it is present or not and install it with the following commands:
برای اینکه این پلاگین کار کند، شما همچنین به ماژول پایتون `fastimport` نیاز دارید.
می‌توانید بررسی کنید که آیا موجود است یا نه و با دستورات زیر آن را نصب کنید:

[source,console]
----
Expand All @@ -52,87 +52,89 @@ Traceback (most recent call last):
ImportError: No module named fastimport
$ pip install fastimport
----
If it is not available, you can download it at address https://pypi.python.org/pypi/fastimport/.
اگر در دسترس نیست، می‌توانید آن را از آدرس https://pypi.python.org/pypi/fastimport/.

In the second case (on Windows), `bzr-fastimport` is automatically installed with the standalone version and the default installation (let all the checkboxes checked).
So in this case you have nothing to do.
در حالت دوم (در ویندوز)، افزونه bzr-fastimport به‌صورت خودکار همراه با نسخه مستقل (standalone) و نصب پیش‌فرض (در صورتی که تمام چک‌باکس‌ها تیک‌خورده باقی بمانند) نصب می‌شود.
بنابراین در این حالت، نیازی به انجام کار خاصی ندارید.

At this point, the way to import a Bazaar repository differs according to that you have a single branch or you are working with a repository that has several branches.
در این مرحله، روش وارد کردن یک مخزن Bazaar بسته به این که فقط یک شاخه داشته باشید یا با مخزنی با چندین شاخه کار می‌کنید، متفاوت است.

===== Project with a single branch
===== Project with a single branch (پروژه با یک شاخه واحد)

Now `cd` in the directory that contains your Bazaar repository and initialize the Git repository:
اکنون `cd` در دایرکتوری که مخزن بازار شما در آن قرار دارد و مخزن گیت را راه‌اندازی کنید:

[source,console]
----
$ cd /path/to/the/bzr/repository
$ git init
----

Now, you can simply export your Bazaar repository and convert it into a Git repository using the following command:
اکنون، می‌توانید به سادگی مخزن بازار خود را صادر کرده و آن را به یک مخزن گیت تبدیل کنید با استفاده از دستور
زیر:

[source,console]
----
$ bzr fast-export --plain . | git fast-import
----

Depending on the size of the project, your Git repository is built in a lapse from a few seconds to a few minutes.
بسته به اندازه پروژه، مخزن Git شما در بازه‌ای از چند ثانیه تا چند دقیقه ساخته می‌شود.

===== Case of a project with a main branch and a working branch

You can also import a Bazaar repository that contains branches.
Let us suppose that you have two branches: one represents the main branch (myProject.trunk), the other one is the working branch (myProject.work).
===== Case of a project with a main branch and a working branch (حالت پروژه‌ای با یک شاخه اصلی و یک شاخه کاری)
شما می‌توانید یک مخزن Bazaar را که شامل چند شاخه است نیز وارد (import) کنید.
فرض کنیم که دو شاخه دارید: یکی شاخه اصلی را نمایش می‌دهد (myProject.trunk) و دیگری شاخه کاری است (myProject.work).

[source,console]
----
$ ls
myProject.trunk myProject.work
----

Create the Git repository and `cd` into it:
مخزن گیت را ایجاد کنید و با دستور `cd` به آن بروید:

[source,console]
----
$ git init git-repo
$ cd git-repo
----

Pull the `master` branch into git:
شاخه `master` را به گیت بکشید:

[source,console]
----
$ bzr fast-export --export-marks=../marks.bzr ../myProject.trunk | \
git fast-import --export-marks=../marks.git
----

Pull the working branch into Git:
شاخه کاری را به گیت بکشید:

[source,console]
----
$ bzr fast-export --marks=../marks.bzr --git-branch=work ../myProject.work | \
git fast-import --import-marks=../marks.git --export-marks=../marks.git
----

Now `git branch` shows you the `master` branch as well as the `work` branch.
Check the logs to make sure they're complete and get rid of the `marks.bzr` and `marks.git` files.
اکنون دستور git branch شاخه master و همچنین شاخه work را به شما نشان می‌دهد.
لاگ‌ها (logs) را بررسی کنید تا مطمئن شوید همه چیز به‌طور کامل منتقل شده، و سپس فایل‌های marks.bzr و marks.git را حذف کنید.

===== Synchronizing the staging area
===== Synchronizing the staging area (همگام‌سازی ناحیه موقت)

Whatever the number of branches you had and the import method you used, your staging area is not synchronized with `HEAD`, and with the import of several branches, your working directory is not synchronized either.
This situation is easily solved by the following command:
فارغ از تعداد شاخه‌هایی که داشتید و روشی که برای وارد کردن آن‌ها استفاده کردید، ناحیه staging شما با `HEAD` همگام نیست، و در صورت وارد کردن چند شاخه، دایرکتوری کاری شما نیز همگام نخواهد بود.
این وضعیت به‌سادگی با اجرای دستور زیر حل می‌شود:

[source,console]
----
$ git reset --hard HEAD
----

===== Ignoring the files that were ignored with .bzrignore
===== نادیده گرفتن فایل‌هایی که با .bzrignore نادیده گرفته شده بودند

حالا بیایید نگاهی به فایل‌های نادیده گرفته شده بیندازیم.
اولین کاری که باید انجام دهید این است که فایل .bzrignore را به .gitignore تغییر نام دهید.

Now let's have a look at the files to ignore.
The first thing to do is to rename `.bzrignore` into `.gitignore`.
If the `.bzrignore` file contains one or several lines starting with "!!" or "RE:", you'll have to modify it and perhaps create several `.gitignore` files in order to ignore exactly the same files that Bazaar was ignoring.
اگر فایل .bzrignore شامل یک یا چند خط باشد که با "!!" یا "RE:" شروع می‌شوند، باید آن را ویرایش کرده و شاید نیاز باشد چند فایل .gitignore جداگانه بسازید تا دقیقاً همان فایل‌هایی را نادیده بگیرید که قبلاً توسط Bazaar نادیده گرفته می‌شدند.

Finally, you will have to create a commit that contains this modification for the migration:
در نهایت، باید یک کامیت ایجاد کنید که این تغییرات را برای ثبت فرآیند مهاجرت شامل شود:

[source,console]
----
Expand All @@ -141,10 +143,10 @@ $ # modify .gitignore if needed
$ git commit -am 'Migration from Bazaar to Git'
----

===== Sending your repository to the server
===== Sending your repository to the server (ارسال مخزن شما به سرور)

Here we are!
Now you can push the repository onto its new home server:
الان آماده‌ایم!
حالا می‌توانید مخزن را به سرور جدید خانه خود ارسال کنید:

[source,console]
----
Expand All @@ -153,4 +155,4 @@ $ git push origin --all
$ git push origin --tags
----

Your Git repository is ready to use.
مخزن گیت شما آماده استفاده است.
Loading