TortoiseGit Manual

Pull and Fetch change

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. the section called “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 the section called “Resolving Conflicts” for more information.

A pull/fetch can be initiated by using TortoiseGit Pull... or TortoiseGit Fetch... . Fetching and pulling changes is also possible using the Sync dialog (cf. the section called “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.

The fetch and pull dialog will open.

Figure 2.14. Pull dialog

Pull dialog


Figure 2.15. Fetch dialog

Fetch dialog


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. the section called “Browse All Refs”) or using the push dialog (cf. the section called “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): Checked: 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 git setting which can be set on the section called “Remote”).

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 the section called “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 the section called “git-fetch(1)” and the section called “git-pull(1)”.