-
1. Почеток
- 1.1 За верзиска контрола
- 1.2 Кратка историја на Git
- 1.3 Основи на Гит
- 1.4 Командната линија
- 1.5 Инсталирање на Git
- 1.6 First-Time Git Setup
- 1.7 Getting Help
- 1.8 Заклучок
-
2. Основите на Git
-
3. Гранење во Git
- 3.1 Гранење објаснето
- 3.2 Основно разгранување и спојување
- 3.3 Branch Management
- 3.4 Работни процеси
- 3.5 Далечински гранки
- 3.6 Ребаза
- 3.7 Заклучок
-
4. Git на Сервер
- 4.1 Протоколите
- 4.2 Добивање на Git на сервер
- 4.3 Генерирање на вашиот SSH јавен клуч
- 4.4 Поставување на серверот
- 4.5 Гит демон
- 4.6 Smart HTTP
- 4.7 GitWeb
- 4.8 GitLab
- 4.9 Опции за домаќини на трети лица
- 4.10 Заклучок
-
5. Дистрибуиран Git
- 5.1 Дистрибуирани работни процеси
- 5.2 Придонес кон проект
- 5.3 Приватен мал тим
- 5.4 Одржување на проект
- 5.5 Заклучок
-
6. GitHub
-
7. Git Алатки
- 7.1 Revision Selection
- 7.2 Интерактивно стажирање
- 7.3 Stashing and Cleaning
- 7.4 Signing Your Work
- 7.5 Searching
- 7.6 Rewriting History
- 7.7 Reset Demystified
- 7.8 Напредно спојување
- 7.9 Rerere
- 7.10 Дебагирање со Git
- 7.11 Submodules
- 7.12 Збивање
- 7.13 Заменување
- 7.14 Складирање на ингеренции
- 7.15 Заклучок
-
8. Персонализација на Git
- 8.1 Git Configuration
- 8.2 Git Атрибути
- 8.3 Git Hooks
- 8.4 An Example Git-Enforced Policy
- 8.5 Заклучок
-
9. Git и други системи
- 9.1 Git како Клиент
- 9.2 Мигрирање кон Git
- 9.3 Заклучок
-
10. Внатрешноста на Git
- 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 Заклучок
-
A1. Appendix A: Git во други околини
- A1.1 Graphical Interfaces
- A1.2 Git in Visual Studio
- A1.3 Git in Eclipse
- A1.4 Git in Bash
- A1.5 Git in Zsh
- A1.6 Git in Powershell
- A1.7 Заклучок
-
A2. Appendix B: Вметнување на Git во вашите апликации
- A2.1 Command-line Git
- A2.2 Libgit2
- A2.3 JGit
- A2.4 go-git
-
A3. Appendix C: Git команди
- 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 Appendix C: Git команди - 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 Барање за одмаглување and we see how to fetch from a bundle in Збивање.
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 Rebase When You Rebase.
We show how to use it with a URL to pull in changes in a one-off fashion in Checking Out Remote Branches.
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 Pushing we go a little deeper into pushing specific branches and in Tracking Branches 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 Working with Remotes, 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.