git fetch
Download remote changes
This command downloads objects and refs from a remote repository, updating your local repository with the latest changes made in the remote repository.
By default, git fetch
retrieves all branches and tags. You can specify a specific branch or tag to fetch using its name. Additionally, you can use flags like --prune
to remove any remote tracking branches that have been deleted on the remote repository, --depth=<number>
to limit the depth of history downloaded, or --tags
to fetch only tags.
Related