Tuesday 21 August 2018

git-merge-local-to-remote

git is basically nothing but pointers .

its just keep references to this pointers and play around with these branch and merge


So, when you want to merge your branch changes to your master .  you need to checkout to master
first and then do the merge of that branch.


> git branch <branch-name> 
           or
> git checkout -b <branch-name>

If you want to create a new branch to retain commits you create, you may

do so (now or later) by using -b with the checkout command again

> git add <some file > and git commit -m <somefile>

> git push origin <branch-name>

> git checkout master

> git merge <branch-name>

you may get conflicts . so , please try to resolve them and then push them to master or branch

> again git commit with removed conflicts -> Merge Success


Create local branch from remote and merge your changes.

> git checkout <origin/branchname>

> git checkout -b '<local branch name>'

> Do temporary changes or any commits to your local

> git checkout <origin/branchnam>

> git merge <localbranchname>

> git push origin <branchname>   ==> Merging to remote place .






No comments:

Post a Comment