How to make git fetch/pull –all the default?

0

Issue

Is it possible to make git fetch, git pull, etc. use the --all flag by default?
I have branches tracking different upstream repositories and I’d like to be able to fetch them all without extra typing.

I tried aliasing the commands in my global .gitconfig:

[alias]
    fetch = fetch --all
    pull = pull --all

But it didn’t work.

Solution

Don’t try to do this for fetch. Use git remote update instead. See the git remote documentation.

Don’t use git pull; it’s not adequate here. Use git remote update first, then use git merge or git rebase with appropriate additional arguments if needed.

Answered By – torek

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More