-
1. شروع به کار
- 1.1 دربارهٔ کنترل نسخه
- 1.2 تاریخچهٔ کوتاهی از گیت
- 1.3 گیت چیست؟
- 1.4 خط فرمان
- 1.5 نصب گیت
- 1.6 اولین راهاندازی گیت
- 1.7 کمک گرفتن
- 1.8 خلاصه
-
2. مقدمات گیت
- 2.1 دستیابی به یک مخزن گیت
- 2.2 ثبت تغییرات در مخزن
- 2.3 دیدن تاریخچهٔ کامیتها
- 2.4 بازگردانی کارها
- 2.5 کار با ریموتها
- 2.6 برچسبگذاری
- 2.7 نامهای مستعار در گیت
- 2.8 خلاصه
-
3. شاخهسازی در گیت
- 3.1 شاخهها در یک کلمه
- 3.2 شاخهسازی و ادغام مقدماتی
- 3.3 مدیریت شاخه
- 3.4 روند کاری شاخهسازی
- 3.5 شاخههای ریموت
- 3.6 ریبیسکردن
- 3.7 خلاصه
-
4. گیت روی سرور
- 4.1 پروتکلها
- 4.2 راهاندازی گیت در سرور
- 4.3 ساختن کلید عمومی SSH
- 4.4 نصب و راهاندازی سرور
- 4.5 دیمن گیت
- 4.6 HTTP هوشمند
- 4.7 گیتوب
- 4.8 گیتلب
- 4.9 گزینههای شخصی ثالث میزبانی شده
- 4.10 خلاصه
-
5. گیت توزیعشده
- 5.1 روندهای کاری توزیعشده
- 5.2 مشارکت در یک پروژه
- 5.3 نگهداری یک پروژه
- 5.4 خلاصه
-
6. GitHub
-
7. Git Tools
- 7.1 Revision Selection
- 7.2 Interactive Staging
- 7.3 Stashing and Cleaning
- 7.4 Signing Your Work
- 7.5 Searching
- 7.6 Rewriting History
- 7.7 Reset Demystified
- 7.8 Advanced Merging
- 7.9 Rerere
- 7.10 Debugging with Git
- 7.11 Submodules
- 7.12 Bundling
- 7.13 Replace
- 7.14 Credential Storage
- 7.15 Summary
-
8. Customizing Git
- 8.1 Git Configuration
- 8.2 Git Attributes
- 8.3 Git Hooks
- 8.4 An Example Git-Enforced Policy
- 8.5 Summary
-
9. Git and Other Systems
- 9.1 Git as a Client
- 9.2 Migrating to Git
- 9.3 Summary
-
10. Git Internals
- 10.1 Plumbing and Porcelain
- 10.2 Git Objects
- 10.3 Git References
- 10.4 Packfiles
- 10.5 The Refspec
- 10.6 Transfer Protocols
- 10.7 Maintenance and Data Recovery
- 10.8 Environment Variables
- 10.9 Summary
-
A1. پیوست A: Git in Other Environments
- A1.1 Graphical Interfaces
- A1.2 Git in Visual Studio
- A1.3 Git in Visual Studio Code
- A1.4 Git in Eclipse
- A1.5 Git in IntelliJ / PyCharm / WebStorm / PhpStorm / RubyMine
- A1.6 Git in Sublime Text
- A1.7 Git in Bash
- A1.8 Git in Zsh
- A1.9 Git in PowerShell
- A1.10 Summary
-
A2. پیوست B: Embedding Git in your Applications
- A2.1 Command-line Git
- A2.2 Libgit2
- A2.3 JGit
- A2.4 go-git
- A2.5 Dulwich
-
A3. پیوست C: Git Commands
- A3.1 Setup and Config
- A3.2 Getting and Creating Projects
- A3.3 Basic Snapshotting
- A3.4 Branching and Merging
- A3.5 Sharing and Updating Projects
- A3.6 Inspection and Comparison
- A3.7 Debugging
- A3.8 Patching
- A3.9 Email
- A3.10 External Systems
- A3.11 Administration
- A3.12 Plumbing Commands
A3.5 پیوست C: Git Commands - Sharing and Updating Projects
Sharing and Updating Projects
There are not very many commands in Git that access the network, nearly all of the commands operate on the local database. When you are ready to share your work or pull changes from elsewhere, there are a handful of commands that deal with remote repositories.
git fetch
The git fetch
command communicates with a remote repository and fetches down all the information that is in that repository that is not in your current one and stores it in your local database.
We first look at this command in فچ و پول کردن از مخازن ریموتتان and we continue to see examples of its use in شاخههای ریموت.
We also use it in several of the examples in مشارکت در یک پروژه.
We use it to fetch a single specific reference that is outside of the default space in Pull Request Refs and we see how to fetch from a bundle in Bundling.
We set up highly custom refspecs in order to make git fetch
do something a little different than the default in The Refspec.
git pull
The git pull
command is basically a combination of the git fetch
and git merge
commands, where Git will fetch from the remote you specify and then immediately try to merge it into the branch you’re on.
We introduce it quickly in فچ و پول کردن از مخازن ریموتتان and show how to see what it will merge if you run it in بازرسی ریموت.
We also see how to use it to help with rebasing difficulties in وقتی ریبیس میکنید ریبیس کنید.
We show how to use it with a URL to pull in changes in a one-off fashion in چکاوت کردن برنچهای ریموت.
Finally, we very quickly mention that you can use the --verify-signatures
option to it in order to verify that commits you are pulling have been GPG signed in Signing Commits.
git push
The git push
command is used to communicate with another repository, calculate what your local database has that the remote one does not, and then pushes the difference into the other repository.
It requires write access to the other repository and so normally is authenticated somehow.
We first look at the git push
command in پوش کردن به ریموتهایتان.
Here we cover the basics of pushing a branch to a remote repository.
In پوشکردن we go a little deeper into pushing specific branches and in پیگیری شاخهها we see how to set up tracking branches to automatically push to.
In پاک کردن شاخههای ریموت we use the --delete
flag to delete a branch on the server with git push
.
Throughout مشارکت در یک پروژه we see several examples of using git push
to share work on branches through multiple remotes.
We see how to use it to share tags that you have made with the --tags
option in اشتراک گذاری برچسبها.
In Publishing Submodule Changes we use the --recurse-submodules
option to check that all of our submodules work has been published before pushing the superproject, which can be really helpful when using submodules.
In Other Client Hooks we talk briefly about the pre-push
hook, which is a script we can setup to run before a push completes to verify that it should be allowed to push.
Finally, in Pushing Refspecs we look at pushing with a full refspec instead of the general shortcuts that are normally used. This can help you be very specific about what work you wish to share.
git remote
The git remote
command is a management tool for your record of remote repositories.
It allows you to save long URLs as short handles, such as “origin” so you don’t have to type them out all the time.
You can have several of these and the git remote
command is used to add, change and delete them.
This command is covered in detail in کار با ریموتها, including listing, adding, removing and renaming them.
It is used in nearly every subsequent chapter in the book too, but always in the standard git remote add <name> <url>
format.
git archive
The git archive
command is used to create an archive file of a specific snapshot of the project.
We use git archive
to create a tarball of a project for sharing in آمادهسازی یک انتشار.
git submodule
The git submodule
command is used to manage external repositories within a normal repositories.
This could be for libraries or other types of shared resources.
The submodule
command has several sub-commands (add
, update
, sync
, etc) for managing these resources.
This command is only mentioned and entirely covered in Submodules.