git - How to merge to a remote tag or a commit id -


i @ local branch , need merge changes remote tag or commit.

i have tried git merge <commit-id> , git merge <tag-name> local keeps saying 'already up-to-date' know it's not. tried git merge origin/<commit-id> said not can merge. missing here? help

you need merge commit local copy of remote branch , push back.

  • you can't merge tag. difference between tag , branch can't move tag forward.
  • you can't merge commit. merge commit. can merge branch has specific commit tip.

the rough method updating remote branch (specifically remote named origin) this:

git fetch git branch <branch-name> origin/<branch-name> git checkout <branch-name> git merge <commit> git push 

if want prove can't merge tag or commit, replace tag or commit sha1. you'll find unable merge.

additionally, while put git merge <commit> in method, should manage merging branches, not individual commits.


Comments