Danny Lin
Danny Lin

Reputation: 2300

Git push multiple branches to corresponding upstream?

I know that setting push.default to upstream makes git push push the current HEAD branch to its corresponding branch in its upstream remote repo if the HEAD branch's upstream is set.

However it'd be better not having to checkout each branch for pushing. Is it possible to push each branch in the repo to its corresponding upstream at once?

Upvotes: 4

Views: 545

Answers (2)

Samy Dindane
Samy Dindane

Reputation: 18706

git push --all should be what you're looking for.

IMO, it's better than changing push.default's value, as you can choose whether you want to push all the branches or not every time you push.

Also, avoid using matching for push.default because of this.

Upvotes: 1

NaN
NaN

Reputation: 8601

This could solve your problem

git config --global push.default matching

Upvotes: 1

Related Questions