Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push changes from one branch to another?

Tags:

git

github

I am working on a local git repository. There are two branches,master and development. I want to push development changes to master branch, how do I do that? When I do:

 git branch -a

I see...

* development
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/development
  remotes/origin/master
like image 910
Tanvir Ahmad Avatar asked Nov 05 '14 07:11

Tanvir Ahmad


Video Answer


1 Answers

Make sure first you update your development branch with master to resolve conflicts issue(if there are any):

git checkout master
git pull origin master
git checkout development
git merge master

Now see if master branch is merged without any conflict, if there's any conflict then you'll have to resolve them. Once you're done with that, you can:

git checkout master
git merge development
git push origin master
like image 63
Surya Avatar answered Oct 18 '22 14:10

Surya