Assume i have a branch master and i have done multiple commit to that branch till 1e3a87c,
now create a new branch from master is dev , push some commit to dev branch till b038437,
now merge dev branch changes into master as below:
# checkout to master branch
# git pull origin dev
# git push origin master
and if you want to merge with tag as below:
#create a tag on dev branch using git tag tag_name
# checkout to master branch
#git merge tag_name
#git push origin master
Now dev branch merge into master branch
As if we want to revert commit before merge then need to use below:
we need to find out the commit id before merge like 1e3a87c in my case
#git reset 1e3a87c
#git reset --hard
#git push -f origin master
Ref: https://stackoverflow.com/questions/7099833/how-to-revert-a-merge-commit-thats-already-pushed-to-remote-branch/7100005#7100005
now create a new branch from master is dev , push some commit to dev branch till b038437,
now merge dev branch changes into master as below:
# checkout to master branch
# git pull origin dev
# git push origin master
and if you want to merge with tag as below:
#create a tag on dev branch using git tag tag_name
# checkout to master branch
#git merge tag_name
#git push origin master
Now dev branch merge into master branch
As if we want to revert commit before merge then need to use below:
we need to find out the commit id before merge like 1e3a87c in my case
#git reset 1e3a87c
#git reset --hard
#git push -f origin master
Ref: https://stackoverflow.com/questions/7099833/how-to-revert-a-merge-commit-thats-already-pushed-to-remote-branch/7100005#7100005
No comments:
Post a Comment