This article will shows you that how you can push new Git branches to remote repositories on GitHub, Gitlab, Bitbucket.
Tracking branches are local branches that have a direct relationship to a remote branch. If you're on a tracking branch and type git pull , Git automatically knows which server to fetch from and which branch to merge in.
Follow the following steps to push any branch to remote repository.
git branch some-branch
, and checkout newly created branch using git checkout some-branch
git commit -m "my first commit in new branch"
git push –set-upstream origin some-branch
Push a new Git branch to a remote repository with practical example
git checkout master
git branch some-branch
git checkout some-branch
git status
git commit -m "myfirst commmit in new branch"
git push --set-upstream origin some-branch