Skip to content

Commit 282d3e7

Browse files
committed
Update aliases.asc
ترجمه بخش دوم نام های مستعار
1 parent 7cd4631 commit 282d3e7

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

book/02-git-basics/sections/aliases.asc

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
=== نام های مستعار در گیت
33

44
(((aliases)))
5-
Before we finish this chapter on basic Git, there's just one little tip that can make your Git experience simpler, easier, and more familiar: aliases.
5+
پیش از پایان بخش پایه های گیت، تنها یک نکته کوچک می ماند که میتواند تجربه ی کارتان را با گیت ساده تر، آسان تر و آشناتر کند: نام های مستعار.
6+
ما دیگر به ....
67
We won't refer to them or assume you've used them later in the book, but you should probably know how to use them.
78

89
گیت توانایی پی بردن خودکار به دستورات نیمه نوشته را ندارد.
910
اگر می خواهید فقط بخشی از یک دستور را تایپ کنید و گیت آن را بشناسد، به سادگی می توان یک نام مستعار با دستور
1011
`git config`.(((git commands, config))) بسازید.
12+
1113
برای ساخت نام مستعار، در اینجا چند مثال می آورید:
1214

1315
[source,console]
@@ -21,31 +23,31 @@ $ git config --global alias.st status
2123
یعنی به جای نوشتن دستور `git commit`, دستور `git ci` بسنده می کند.
2224
همین طور که با گیت کار می کنید، شاید دستوری دیگر را بسیار تکرار کنید; با خیال آسوده نامهای مستعار بسازید.
2325

24-
This technique can also be very useful in creating commands that you think should exist.
25-
For example, to correct the usability problem you encountered with unstaging a file, you can add your own unstage alias to Git:
26+
این ریزه کاری در ساخت دستوراتی که از نظر شما باید در گیت باشد، می تواند بسیار کمک کند.
27+
برای نمونه، برای رفع مشکل برگشت استقرار موقت یا همان unstaging کردن یک فایل، می توانید دستور ویژه خودتان را به گیت بیافزایید:
2628

2729
[source,console]
2830
----
2931
$ git config --global alias.unstage 'reset HEAD --'
3032
----
3133

32-
This makes the following two commands equivalent:
34+
با این کار دو دستور زیر با هم برابرند و یک کار را انجام می دهند.:
3335

3436
[source,console]
3537
----
3638
$ git unstage fileA
3739
$ git reset HEAD -- fileA
3840
----
3941

40-
This seems a bit clearer.
41-
It's also common to add a `last` command, like this:
42+
کمی روشن تر شد.
43+
ایجاد دستور `last` هم فراگیر است، به این شکل:
4244

4345
[source,console]
4446
----
4547
$ git config --global alias.last 'log -1 HEAD'
4648
----
4749

48-
This way, you can see the last commit easily:
50+
با این روش، به سادگی می توانید آخرین ثبت خود را ببینید.
4951

5052
[source,console]
5153
----
@@ -59,11 +61,14 @@ Date: Tue Aug 26 19:48:51 2008 +0800
5961
Signed-off-by: Scott Chacon <[email protected]>
6062
----
6163

62-
As you can tell, Git simply replaces the new command with whatever you alias it for.
63-
However, maybe you want to run an external command, rather than a Git subcommand.
64-
In that case, you start the command with a `!` character.
65-
This is useful if you write your own tools that work with a Git repository.
66-
We can demonstrate by aliasing `git visual` to run `gitk`:
64+
65+
As you can tell,گیت به سادگی دستور جدید را با هرآنجه شما به عنوان نام مستعار می سازید جایگزین می کند.
66+
با این وجود، شاید شما بخواهید یک دستور بیرونی را اجرا کنید نه یک دستور زیر مجموعه ی گیت.
67+
در این مورد، دستور را با علامت `!` آغاز می کنیم.
68+
این کار زمانی سودمند است که شما ابزار خودتان را برای کار با مخازن گیت ایجاد کرده اید.
69+
70+
ما می توانیم با نام مستعار، به جای دستور `gitk` ، دستور `git visual` را بکار بگیریم. به این ترتیب:
71+
6772

6873
[source,console]
6974
----

0 commit comments

Comments
 (0)