How to push all branches to remote in Git
In this tutorial, we are going to learn about how to push all local branches to a remote GitHub repository in Git.
Normally, we create a local branches in our git by using the
git checkout -b followed by the branch name
git checkout -b test
but this branches doesn’t have any track with remote ones.
Pushing all Branches to remote in Git
To push the all branches to a remote git, we can use the
git push command followed by the
--all flag and origin.
Here is an example:
git push --all origin
This will create a track with the local branches to the remote branches.