Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push new branch upstream

Tags:

egit

I have a local repository and a remote repository on Github. I just created two new local branches, Documentation and Development, using origin/master as the upstream source.

How do I push these new branches upstream. I have made no changes in the new branches yet so there is no new content, simply the branches themselves.

Right now I want to create a new topic branch using origin/Development as the upstream but it is not there yet.

like image 610
Jonathan Avatar asked Jan 29 '26 06:01

Jonathan


1 Answers

You don't need any new commits on the branch to do a push. The key for creating and tracking corresponding branches on the remote is using the --set-upstream flag.

$ git checkout -b Documentation
$ git push --set-upstream origin Documentation

Short flag form:

$ git checkout -b Documentation
$ git push -u origin Documentation
like image 168
SnoProblem Avatar answered Feb 02 '26 08:02

SnoProblem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!