Git fetch: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Git Commands")
 
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[Git_Commands#Remote_Repository_Interaction|Git Commands]]
* [[Git_Commands#Remote_Repository_Interaction|Git Commands]]
* [[git pull]]
=Overview=
<tt>git fetch</tt> downloads branches, tags and all objects necessary to complete their histories. When the command completes, [[Git_Concepts#Tracking_Branch_.28Remote-Tracking_Branch.29|remote-tracking branches]] are updated accordingly. When no remote is specified, by default the origin remote will be used, unless there is an upstream branch configured for the current branch. The names of refs that are fetched, together with the object names they point at, are written to .git/FETCH_HEAD. [[git pull]] uses this information.
=Options=
==--prune==
Before fetching, remove any remote-tracking references that no longer exist on the remote (tags may behave differently in respect to pruning).

Latest revision as of 16:03, 7 August 2023

Internal

Overview

git fetch downloads branches, tags and all objects necessary to complete their histories. When the command completes, remote-tracking branches are updated accordingly. When no remote is specified, by default the origin remote will be used, unless there is an upstream branch configured for the current branch. The names of refs that are fetched, together with the object names they point at, are written to .git/FETCH_HEAD. git pull uses this information.

Options

--prune

Before fetching, remove any remote-tracking references that no longer exist on the remote (tags may behave differently in respect to pruning).