Git: automatic fetching from remote repositories?

In zsh, there is the git-auto-fetch plugin which

Automatically fetches all changes from all remotes while you are working in git-initialized directory.

Just add to your plugins in .zshrc.


If you would prefer to use a GUI like SourceTree, there's a preference option that checks default remotes every X minutes.

You could also set global alias in the global .gitconfig file under [alias]. Such as git fetch --all && git status (add -s for short status). Or possibly git stash && git pull && git stash apply && git status et al, if you currently have changes. But watch out for merge conflicts.


One of those commands is already built in.

git pull

does a fetch and a merge.

For the other one, well....define your own command, such as

alias gitfu='git fetch; git status'

The shell is yours to command.

Depending on your configuration you may be asked for pass phrase or credentials for each of these.