3 Automatically fetches all changes from all remotes while you are working in a git-initialized directory.
5 To use it, add `git-auto-fetch` to the plugins array in your zshrc file:
8 plugins=(... git-auto-fetch)
13 Every time the command prompt is shown all remotes will be fetched in the background. By default,
14 `git-auto-fetch` will be triggered only if the last auto-fetch was done at least 60 seconds ago.
15 You can change the fetch interval in your .zshrc:
18 GIT_AUTO_FETCH_INTERVAL=1200 # in seconds
21 A log of `git fetch --all` will be saved in `.git/FETCH_LOG`.
23 ## Toggle auto-fetch per folder
25 If you are using a mobile connection or for any other reason you can disable git-auto-fetch
38 Automatically fetching all changes defeats the purpose of `git push --force-with-lease`,
39 and makes it behave like `git push --force` in some cases. For example:
41 Consider that you made some changes and possibly rebased some stuff, which means you'll
42 need to use `--force-with-lease` to overwrite the remote history of a branch. Between the
43 time when you make the changes (maybe do a `git log`) and the time when you `git push`,
44 it's possible that someone else updates the branch you're working on.
46 If `git-auto-fetch` triggers then, you'll have fetched the remote changes without knowing
47 it, and even though you're running the push with `--force-with-lease`, git will overwrite
48 the recent changes because you already have them in your local repository. The
49 [`git push --force-with-lease` docs](https://git-scm.com/docs/git-push) talk about possible
50 solutions to this problem.