Reputation: 107
Created a repository and created a new feature branch. Pushed all my code changes to the feature branch. There is nothing committed to the master branch. I want to push my latest code to the remote master branch. How do I do that?
Upvotes: 2
Views: 12272
Reputation: 2028
I hope, your remote repository is added to your local repository. Steps to follow:
git checkout master
git merge feature-branch
git push origin master
Upvotes: 3
Reputation: 11
On your machine, switch to the master branch and merge your feature branch on master. Then push your local master branch to the remote master branch.
git checkout master
git merge my-feature-branch
git push origin master
Upvotes: 1
Reputation: 12209
You'll probably want to merge the changes to master if you want to push to origin master. As a general rule, your local and origin repo should look similar. Otherwise, if you tried to push to origin master in the future, from your local master or another branch besides feature, you would have to pull and merge anyway.
git checkout master
git merge feature
git push origin master
Upvotes: 2