You can instruct pull
to fetch only your local branch, by passing the arguments to pull
, for example:
git pull origin develop
# or if you always track a branch of the same name, perhaps an alias like:
[alias]
p = !git pull origin $(git branch --show-current)
That way you will only fetch and merge (or rebase) the branch you specify.
As for "all" of your local branches, I don't think you can change the behavior of git pull
to fetch all of, and only, your local branches in a single command. You could create an alias to loop through each local branch name and fetch that branch, perhaps like this (in bash):
git for-each-ref --format='%(refname:short)' refs/heads/ | xargs git fetch origin
That being said, since the reason you wish to do this is to avoid printing out all the remotes in your lg
alias, you could try simply removing the --all
option from your alias, which says to include all local and remote branches. The --branches
option which you also already have (which is currently redundant), says to include all of your local branches. After removing --all
, you should be able to simply git fetch
(or let pull
fetch all branches), and your lg
alias will still work (similarly) to what you've been doing. A caveat here is that this will no longer also show the corresponding remote versions of your local branches, so that may not be exactly what you want.