This section talks about how to fetch or pull (i.e., download) changes from another repository. The difference between pull and fetch is:
Fetch just downloads the objects and refs from a remote repository and normally updates the remote tracking branches. Pull, however, will not only download the changes, but also merges them - it is the combination of fetch and merge (cf. Section 2.28, “Merging”). The configured remote tracking branch is selected automatically.
Important | |
---|---|
Whenever you merge, it is possible the a file was changed in both branches and that the changes cannot be merged automatically: This is called a "conflict" and needs to be manually resolved. See Section 2.31, “Resolving Conflicts” for more information. |
A pull/fetch can be initiated by using Section 2.9, “Sync”), however, there you have less options, but the sync dialog allows you to initiate other operations such as pushing and to see diffs and changes.
→ or → . Fetching and pulling changes is also possible using the Sync dialog (cf.The fetch and pull dialog will open.
Remote Choose a configured remote repository (these can be changes using the Manage Remotes label). Instead of the configured repositories, you can also put the URL of another repository into the Arbitrary URL textbox.
If the current active branch has a remote tracked branch set, the remote branch and remote repository are automatically selected. A remote tracked branch can be set using the reference browser (cf. Section 2.11, “Browse All Refs”) or using the push dialog (cf. Section 2.8, “Push”).
Other: Input Other URL or local directory. You can click to browse directory.
If you check the Autoload Putty Key checkbox, a configured Putty key will be automatically loaded using Pageant.
Tags has three states (git 1.9 and later): Checked: All tags as well as branches are downloaded (--tags is passed to git), unchecked: No tags are downloaded (--no-tags is passed to git), and third state: use default behavior (based on remote name
.tagopt setting).
Tags has three states (prior to git 1.9): Only all tags are downloaded but no branches are downloaded (--tags is passed to git), unchecked: No tags are downloaded (--no-tags is passed to git), and third state: use default behavior (based on remote name
.tagopt setting).
Prune has three states: True to remove remote-tracking branches which no longer exist on the remote, false: not to remove, and third state: use default behavior (based on remote name
.prune or fetch.prune setting).
Tip | |
---|---|
You can find more information about PuTTY and using ssh-keys at Appendix F, Tips and tricks for SSH/PuTTY. There is also explained how you can use several accounts at the same time for a remote. |
Conflicts | |
---|---|
Although major merge work is done by git automatically while pulling, a conflict may happen during cherry-picking (i.e., a file was modified in your current branch and also in the branch you are pulling), please see Section 2.31, “Resolving Conflicts” on how to resolve conflicts. Please note, that "REMOTE"/"theirs" in the conflict editor refers to the to the changes your on the branch you selected for pulling/merging and "LOCAL"/"mine" to your HEAD version in your working tree. |
You can find more information at Section G.3.46, “git-fetch(1)” and Section G.3.95, “git-pull(1)”.