git fetch
Jump to navigation
Jump to search
git fetch (docs) downloads new commits, branches, and tags from a remote repository into your local repository's remote-tracking references (e.g. origin/main), without modifying your working directory or current branch. It lets you see what has changed remotely before deciding to integrate those changes with git merge or git rebase.
In short: it updates your knowledge of the remote, but leaves your local work untouched.
Download objects and refs from another repository.
Commands[edit]
git fetch --helpgit fetchgit -Cgit fetch origingit fetch --allgit fetch --dry-rungit fetch --prunegit fetch -v
Examples[edit]
git fetch (no output)
git fetch https://github.com/zabbix/zabbix-docker.git fatal: not a git repository (or any of the parent directories): .git Solution: git clone
Errors[edit]
fatal: not a git repository (or any of the parent directories): .git
Related commands[edit]
git pullgit fetch upstreamgit mergegit rebasegit fetch,git pull,git clonegit checkout- Latest items from git fetch:
git reflog -1 origin/main --date=iso - ghorg
Activities[edit]
- Read about the differences between
git pullandgit fetch: https://stackoverflow.com/questions/292357/what-is-the-difference-between-git-pull-and-git-fetch - Install and configure:
npm install -g git-auto-fetch ls -d */ | xargs -I {} git -C {} fetch --all
See also[edit]
Advertising: