Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to git push to a local branch?

Tags:

git

I git clone a project on my computer and have a local master branch, let say A. Here, I create some local branches (let say B and C).

I made some changes in B and C. So, how do I can git push to merge the changes in B and C to A?

Normally, I see that

 git push origin master 
to push to the remote repository, but I want to push to a local branch.

Thanks

like image 291
chipbk10 Avatar asked Aug 10 '16 08:08

chipbk10


1 Answers

Use git merge instead to manipulate local branches.

git checkout master
git merge B
git merge C

If you really want to push a local branch to another local branch, git push . B:master, though this is quite rare.

like image 156
ElpieKay Avatar answered Sep 27 '22 17:09

ElpieKay